fixing path
This commit is contained in:
parent
400b9c0b28
commit
ba612f1b2b
12 changed files with 325 additions and 723 deletions
13
src/app.ts
13
src/app.ts
|
|
@ -4,11 +4,10 @@ import cors from "cors";
|
|||
import express from "express";
|
||||
import swaggerUi from "swagger-ui-express";
|
||||
import swaggerDocument from "./swagger.json";
|
||||
import * as cron from "node-cron";
|
||||
import error from "./middlewares/error";
|
||||
import { AppDataSource } from "./database/data-source";
|
||||
import { RegisterRoutes } from "./routes";
|
||||
// import logMiddleware from "./middlewares/logs";
|
||||
import logMiddleware from "./middlewares/logs";
|
||||
|
||||
async function main() {
|
||||
await AppDataSource.initialize();
|
||||
|
|
@ -18,11 +17,11 @@ async function main() {
|
|||
app.use(
|
||||
cors({
|
||||
origin: "*",
|
||||
})
|
||||
}),
|
||||
);
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
// app.use(logMiddleware);
|
||||
app.use(logMiddleware);
|
||||
app.use("/", express.static("static"));
|
||||
app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(swaggerDocument));
|
||||
|
||||
|
|
@ -36,11 +35,9 @@ async function main() {
|
|||
APP_PORT,
|
||||
APP_HOST,
|
||||
() => (
|
||||
console.log(
|
||||
`[APP] Application is running on: http://localhost:${APP_PORT}`
|
||||
),
|
||||
console.log(`[APP] Application is running on: http://localhost:${APP_PORT}`),
|
||||
console.log(`[APP] Swagger on: http://localhost:${APP_PORT}/api-docs`)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue