@blaasvaer/frmwrk 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +9 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -10,6 +10,9 @@
10
10
  * Native modules
11
11
  */
12
12
  const http = require('http');
13
+
14
+ let port;
15
+
13
16
  /**
14
17
  * Custom modules
15
18
  */
@@ -27,7 +30,11 @@ server;
27
30
  * otherwise use default 3000
28
31
  * @type {Number}
29
32
  */
30
- const port = ( process.argv.length > 2 ) ? parseInt( process.argv[ process.argv.length - 1 ] ) : 3000;
33
+ if ( ! process.env.NODE_PORT ) {
34
+ port = ( process.argv.length > 2 ) ? parseInt( process.argv[ process.argv.length - 1 ] ) : 3000;
35
+ } else {
36
+ port = process.env.NODE_PORT;
37
+ }
31
38
 
32
39
  if ( process.env.NODE_ENV !== 'production') {
33
40
  // console.log("ENV file", process.env.PGHOST);
@@ -41,7 +48,7 @@ if ( process.env.NODE_ENV !== 'production') {
41
48
  FW = function ( config ) {
42
49
  let _this = this;
43
50
 
44
- hostname = config.hostname ? config.hostname : '127.0.0.1';
51
+ hostname = config.hostname ? config.hostname : '0.0.0.0';
45
52
 
46
53
  controllers = {};
47
54
  models = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaasvaer/frmwrk",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "My personal Node framework",
5
5
  "main": "index.js",
6
6
  "scripts": {