diff --git a/app.js b/app.js index 6faeaad..31e3ec8 100644 --- a/app.js +++ b/app.js @@ -7,17 +7,20 @@ const path = require("path"); const moment = require("moment"); require("dotenv").config(); const log = require("node-file-logger"); +const debug = true; const app = express(); const port = process.env.PORT; -const cors = require('cors'); +const cors = require("cors"); // Konfiguration: Erlaube Frontend-Port -app.use(cors({ - origin: 'http://localhost:5173', - credentials: true // Wenn du Cookies / Sessions brauchst (z.B. JWT in Cookies) -})); +app.use( + cors({ + origin: "http://localhost:5173", + credentials: true, // Wenn du Cookies / Sessions brauchst (z.B. JWT in Cookies) + }) +); const options = { timeZone: "europe/Berlin", @@ -103,6 +106,9 @@ app.use( ); const server = app.listen(port, "0.0.0.0", () => { - console.log(`Server is running on ${process.env.HOST}:${port}/`); - log.Info(`Server is running on ${process.env.HOST}:${port}/`); + if (debug) { + console.log(`Server is running on ${process.env.HOST}:${port}/`); + } else { + log.Info(`Server is running on ${process.env.HOST}:${port}/`); + } });