add env vars
This commit is contained in:
1 parent
c13a3e93b2
commit
870e84b539
2 files changed
+10
-2
No files matched your search
@@ -99,6 +99,8 @@ const openApiSpec = JSON.parse(
|
||||
fs.readFileSync(path.join(__dirname, "openapi.json"), "utf8")
|
||||
);
|
||||
|
||||
const frontendPath = path.join(__dirname, "public");
|
||||
|
||||
let server;
|
||||
|
||||
const shutdown = async () => {
|
||||
@@ -308,6 +310,7 @@ const startApp = async () => {
|
||||
const notificationRoutes = new NotificationRoutes(notificationController);
|
||||
const diagnosticRoutes = new DiagnosticRoutes(diagnosticController);
|
||||
// Middleware
|
||||
app.use(express.static(frontendPath));
|
||||
app.use(responseHandler);
|
||||
app.use(
|
||||
cors({
|
||||
@@ -353,6 +356,10 @@ const startApp = async () => {
|
||||
status: "OK",
|
||||
});
|
||||
});
|
||||
// FE routes
|
||||
app.get("*", (req, res) => {
|
||||
res.sendFile(path.join(frontendPath, "index.html"));
|
||||
});
|
||||
app.use(handleErrors);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user