Browse Source

Changement port par defaut https (80 => 443)

Loquicom 5 years ago
parent
commit
59d2240294
1 changed files with 5 additions and 5 deletions
  1. 5 5
      node/main.js

+ 5 - 5
node/main.js

@@ -6,6 +6,10 @@ process.on('SIGINT', function () {
     process.exit();
 });
 
+// Chargement fichier config
+const config = require('./src/config');
+const protocol = (config.https) ? 'https' : 'http';
+
 // Gestion des commandes et des options de l'application
 const argv = require('yargs')
     .command('serve [port]', 'start the Loquicompta server', (yargs) => {
@@ -19,7 +23,7 @@ const argv = require('yargs')
     })
     .option('port', {
         alias: 'p',
-        default: 80
+        default: (config.https) ? 443 : 80
     })
     .option('auth', {
         default: true
@@ -34,10 +38,6 @@ const argv = require('yargs')
     .describe('s', 'show sql informations')
     .argv;
 
-// Chargement fichier config
-const config = require('./src/config');
-const protocol = (config.https) ? 'https' : 'http';
-
 // Creation variable globale
 if (!config.auth) {
     global.auth = false;