add env vars

This commit is contained in:
Alex Holliday
2025-05-19 15:04:58 -07:00
parent c13a3e93b2
commit 870e84b539
2 changed files with 10 additions and 2 deletions

View File

@@ -4,8 +4,9 @@ services:
restart: always
ports:
- "52345:52345"
env_file:
- server.env
environment:
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
- UPTIME_APP_CLIENT_HOST=http://localhost
depends_on:
- redis
- mongodb

View File

@@ -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);
};