Skip to content
Snippets Groups Projects
Commit 91bd2d50 authored by João Victor Tozatti Risso's avatar João Victor Tozatti Risso
Browse files

Add check for the minimum compatible version of Node in server module

parent c19b73a8
No related branches found
No related tags found
1 merge request!116Release v1.0.0
Pipeline #
...@@ -8,6 +8,13 @@ const log = require(`${libs}/log`)(module); ...@@ -8,6 +8,13 @@ const log = require(`${libs}/log`)(module);
const app = require(`${libs}/app`); const app = require(`${libs}/app`);
const compatVersion = require(`${libs}/middlewares/checkVersion`);
// Check if Node version is compatible
if (!compatVersion()) {
process.exit(1);
}
// Set default port: first environment variable PORT, then configuration and last 3000 // Set default port: first environment variable PORT, then configuration and last 3000
app.set('port', process.env.PORT || config.port || 3000); app.set('port', process.env.PORT || config.port || 3000);
process.env.NODE_ENV = process.env.NODE_ENV || 'development'; process.env.NODE_ENV = process.env.NODE_ENV || 'development';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment