Files
abumahid 61fd639faf feat(account, order, plan, profile, redis): enhance functionality and security
- Updated CORS settings for frontend compatibility.
- Integrated Redis URL configuration.
- Improved login response structure in account service.
- Added role-based authorization for order and plan management.
- Enhanced error handling and logging in profile and plan services.
- Updated Swagger documentation for clarity on order statuses.
- Configured Redis connection for better performance.
2026-04-26 19:14:37 +06:00

49 lines
1.8 KiB
JavaScript

import { fileURLToPath } from "node:url";
import path from "path";
import { configs } from "./app/configs/index.js";
import { accountSwaggerDocs } from "./app/modules/account/account.swagger.js";
import { orderSwaggerDocs } from "./app/modules/order/order.swagger.js";
import { planSwaggerDocs } from "./app/modules/plan/plan.swagger.js";
import { profileSwaggerDocs } from "./app/modules/profile/profile.swagger.js";
import { supportSwaggerDocs } from "./app/modules/support/support.swagger.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export const swaggerOptions = {
definition: {
openapi: "3.0.0",
info: {
title: "API Doc - Build with exp-node-server",
version: "1.0.0",
description: "Express + Prisma API with auto-generated Swagger docs",
},
paths: {
...accountSwaggerDocs,
...planSwaggerDocs,
...orderSwaggerDocs,
...profileSwaggerDocs,
...supportSwaggerDocs,
},
servers: configs.env === "production"
? [{ url: "https://quicklunch-server.onrender.com" }, { url: "http://localhost:5000" }]
: [{ url: "http://localhost:5000" }, { url: "https://quicklunch-server.onrender.com" }],
components: {
securitySchemes: {
AuthorizationToken: {
type: "apiKey",
in: "header",
name: "Authorization",
description: "Put your accessToken here ",
},
},
},
security: [
{
AuthorizationToken: [],
},
],
},
apis: [
path.join(__dirname, configs.env === "production" ? "./**/*.js" : "./**/*.ts"),
],
};