Commit c2c12fb6 authored by Phạm Quang Bảo's avatar Phạm Quang Bảo

fix: run build

parent f614a216
......@@ -10,7 +10,7 @@
"test": "echo \"Error: no test specified\" && exit 1",
"gen:db": "tsx src/scripts/database-gen.ts",
"gen:swagger": "tsx src/scripts/swagger-gen.ts",
"build": "tsx ./src/scripts/database-gen.ts && tsx ./src/scripts/swagger-gen.ts && tsc && mkdir -p dist/docs/swagger && cp src/docs/swagger/swagger-output.json dist/docs/swagger/",
"build": "tsx ./src/scripts/database-gen.ts && tsx ./src/scripts/swagger-gen.ts && tsc && cpx \"src/docs/swagger/swagger-output.json\" dist/docs/swagger",
"start": "node ./dist/index.js"
},
"imports": {
......@@ -96,6 +96,7 @@
"@types/nodemailer": "^8.0.0",
"@types/swagger-jsdoc": "^6.0.4",
"@types/swagger-ui-express": "^4.1.8",
"cpx": "^1.5.0",
"esbuild": "^0.28.0",
"ts-node": "^10.9.2",
"tsx": "^4.21.0",
......
This diff is collapsed.
......@@ -3,12 +3,14 @@ import { resolve } from 'path';
import _autoroutes from 'express-automatic-routes';
import swaggerUi from 'swagger-ui-express';
import dotenv from 'dotenv';
import swaggerFile from '#docs/swagger/swagger-output.json' with { type: 'json' };
import response from '#middlewares/response.js';
import emailCronJob from '#services/schedulerService.js';
import { createRequire } from 'module';
dotenv.config();
const require = createRequire(import.meta.url);
const app = express()
const port = 3000
......@@ -16,6 +18,7 @@ app.use(express.json());
app.use(response as express.RequestHandler);
const mountRoutes = (_autoroutes as any).default || _autoroutes;
const swaggerFile = require('#docs/swagger/swagger-output.json');
mountRoutes(app, {
dir: resolve(import.meta.dirname, './controllers'),
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment