♻️ refactor(account, order, plan, profile, support, email): restructure application modules and enhance error handling
Updated Docker configuration, refactored middleware for improved error handling, and restructured account, order, plan, profile, and support modules, including their routes, services, and validations. Enhanced email processing queues and utilities for token generation, pagination, and response management to streamline the application architecture and enhance maintainability.
This commit is contained in:
Vendored
+48
@@ -0,0 +1,48 @@
|
||||
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://live-url.com" }, { url: "http://localhost:5000" }]
|
||||
: [{ url: "http://localhost:5000" }, { url: "https://live-url.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"),
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user