fix: cannot reach api endpoint
This commit is contained in:
parent
5bc3d5580e
commit
2850d82238
1 changed files with 1 additions and 3 deletions
|
|
@ -19,7 +19,6 @@ if (process.env.NODE_ENV !== "production") app.use(cors());
|
|||
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use(express.static("static"));
|
||||
app.use("/docs", swaggerUi.serve, swaggerUi.setup(swaggerSpecs, { explorer: false }));
|
||||
|
||||
RegisterRoutes(router);
|
||||
|
|
@ -27,8 +26,7 @@ RegisterRoutes(router);
|
|||
app.use(swaggerSpecs.basePath, router);
|
||||
app.use(errorHandler);
|
||||
|
||||
app.use(express.static("static"));
|
||||
app.get("*", (_req, res) => {
|
||||
app.use((_req, res, _next) => {
|
||||
res.sendFile(`${process.cwd()}/static/index.html`);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue