2026-04-02 21:27:09 +06:00
|
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
|
import path from "path";
|
2026-04-21 03:12:39 +06:00
|
|
|
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";
|
2026-04-02 21:27:09 +06:00
|
|
|
|
|
|
|
|
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,
|
2026-04-12 22:47:56 +06:00
|
|
|
...planSwaggerDocs,
|
|
|
|
|
...orderSwaggerDocs,
|
2026-04-15 23:38:15 +06:00
|
|
|
...profileSwaggerDocs,
|
|
|
|
|
...supportSwaggerDocs,
|
2026-04-02 21:27:09 +06:00
|
|
|
},
|
|
|
|
|
servers:
|
|
|
|
|
configs.env === "production"
|
2026-04-21 03:12:39 +06:00
|
|
|
? [{ url: "https://quicklunch-server.onrender.com" }, { url: "http://localhost:5000" }]
|
|
|
|
|
: [{ url: "http://localhost:5000" }, { url: "https://quicklunch-server.onrender.com" }],
|
2026-04-02 21:27:09 +06:00
|
|
|
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",
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
};
|