@blaasvaer/frmwrk 0.2.5 → 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.
package/connections.js CHANGED
@@ -14,12 +14,12 @@ function installconnections ( config ) {
14
14
  const connection_files = [];
15
15
 
16
16
  files.forEach( file => {
17
- let connection_name = file.split('.')[0];
18
-
19
17
  // Skip file if name start with an underscore
20
- if ( file.charAt(0) === '_' )
18
+ if ( file.charAt(0) === '_' || file === '.DS_Store' )
21
19
  return;
22
20
 
21
+ let connection_name = file.split('.')[0];
22
+
23
23
  let promise = new Promise( function ( resolve, reject ) {
24
24
 
25
25
  let connection = require( connections_dir + file );
package/controllers.js CHANGED
@@ -13,7 +13,7 @@ function installControllers ( config ) {
13
13
 
14
14
  files.forEach( file => {
15
15
  // Skip file if name start with an underscore
16
- if ( file.charAt(0) === '_' )
16
+ if ( file.charAt(0) === '_' || file === '.DS_Store' )
17
17
  return;
18
18
 
19
19
  let promise = new Promise( function( resolve, reject ) {
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/models.js CHANGED
@@ -13,7 +13,7 @@ function installModels ( config ) {
13
13
 
14
14
  files.forEach( file => {
15
15
  // Skip file if name start with an underscore
16
- if ( file.charAt(0) === '_' )
16
+ if ( file.charAt(0) === '_' || file === '.DS_Store' )
17
17
  return;
18
18
 
19
19
  let promise = new Promise( function ( resolve, reject ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaasvaer/frmwrk",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "My personal Node framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/views.js CHANGED
@@ -36,6 +36,12 @@ function Views ( config ) {
36
36
  .isFile()
37
37
  ? readFile( path )
38
38
  .then(function ( template ) {
39
+ // Prevent .DS_Store files from breaking templates
40
+ let ds_store_file_path = path.split('/');
41
+
42
+ if ( ds_store_file_path[ ds_store_file_path.length - 1 ] === '.DS_Store' )
43
+ return;
44
+
39
45
  let tpl = 'Handlebars.template(' + Handlebars.precompile( template.toString() ) + ')';
40
46
 
41
47
  if ( config.compress_html ) {