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