Files
quicklanch-server/dist/swaggerOptions.js
T

49 lines
1.8 KiB
JavaScript
Raw Normal View History

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"),
],
};