From 108722f4c69f7a075673af2458a30b7e0252f66b Mon Sep 17 00:00:00 2001 From: Ryahn Date: Mon, 27 Jan 2025 21:08:44 -0500 Subject: [PATCH] add new config --- .gitignore | 1 + app.js | 6 +++--- src/config/main-example.js | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 src/config/main-example.js diff --git a/.gitignore b/.gitignore index 135f660..3d4fc12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules database.js haraka.js +main.js *.log diff --git a/app.js b/app.js index 8b0408d..302bc06 100644 --- a/app.js +++ b/app.js @@ -6,6 +6,7 @@ const knexConfig = require('./src/config/database'); const MessageService = require('./src/email_server/services/MessageService'); const swaggerJsdoc = require('swagger-jsdoc'); const swaggerUi = require('swagger-ui-express'); +const config = require('./src/config/main'); const swaggerOptions = { definition: { @@ -60,7 +61,6 @@ cron.schedule('0 0 * * *', async () => { } }); -const PORT = 3000; -app.listen(PORT, () => { - console.log(`API server running on port ${PORT}`); +app.listen(config.site.port, () => { + console.log(`API server running on port ${config.site.port}`); }); \ No newline at end of file diff --git a/src/config/main-example.js b/src/config/main-example.js new file mode 100644 index 0000000..21b4467 --- /dev/null +++ b/src/config/main-example.js @@ -0,0 +1,5 @@ +module.exports = { + site: { + port: 3000, + } + }; \ No newline at end of file