Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
@@ -12,3 +12,3 @@ | ||
if ( config.mongodb ) | ||
if ( config.mongoDB ) | ||
{ | ||
@@ -18,3 +18,3 @@ | ||
{ | ||
link: config.mongodb | ||
link: config.mongoDB | ||
}; | ||
@@ -21,0 +21,0 @@ |
@@ -22,58 +22,60 @@ | ||
async.waterfall( [ | ||
async | ||
.waterfall( [ | ||
( done ) => { | ||
( done ) => { | ||
fs.readdir( params.models, ( err, files ) => { | ||
fs | ||
.readdir( params.models, ( err, files ) => { | ||
if ( err ) | ||
{ | ||
return done( err ); | ||
} | ||
if ( err ) | ||
{ | ||
return done( err ); | ||
} | ||
async | ||
.each( files, ( file, next ) => { | ||
async | ||
.each( files, ( file, next ) => { | ||
const data = require( path.join( process.cwd(), params.models, file ) ); | ||
const data = require( path.join( process.cwd(), params.models, file ) ); | ||
if ( ! data.name ) | ||
{ | ||
return next( 'model has no name property' ); | ||
} | ||
if ( ! data.name ) | ||
{ | ||
return next( 'model has no name property' ); | ||
} | ||
if ( ! data.params ) | ||
{ | ||
return next( 'model has no params property' ); | ||
} | ||
if ( ! data.params ) | ||
{ | ||
return next( 'model has no params property' ); | ||
} | ||
const schema = mongoose.Schema( data.params ); | ||
const schema = mongoose.Schema( data.params ); | ||
if ( data.methods ) | ||
{ | ||
_.each( data.methods, ( fn, name ) => ( schema.methods[ name ] = fn ) ); | ||
} | ||
if ( data.methods ) | ||
{ | ||
_.each( data.methods, ( fn, name ) => ( schema.methods[ name ] = fn ) ); | ||
} | ||
if ( data.statics ) | ||
{ | ||
_.each( data.statics, ( fn, name ) => ( schema.statics[ name ] = fn ) ); | ||
} | ||
if ( data.statics ) | ||
{ | ||
_.each( data.statics, ( fn, name ) => ( schema.statics[ name ] = fn ) ); | ||
} | ||
mongoose.model( data.name, schema ); | ||
mongoose.model( data.name, schema ); | ||
return next(); | ||
return next(); | ||
}, done ); | ||
}, done ); | ||
} ); | ||
} ); | ||
} | ||
} | ||
], ( err ) => { | ||
], ( err ) => { | ||
if ( err ) | ||
{ | ||
throw new Error( err ); | ||
} | ||
if ( err ) | ||
{ | ||
throw new Error( err ); | ||
} | ||
} ); | ||
} ); | ||
@@ -80,0 +82,0 @@ } |
{ | ||
"name": "blacktide", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"description": "Lightweight back-end framework for Micro-services and APIs with added security", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -24,2 +24,8 @@ | ||
## How to run with pm2 | ||
`$ NODE_ENV=production pm2 start services/ --name 'myapp'` | ||
## Getting started (with blacktide-cli) | ||
## Usage | ||
@@ -26,0 +32,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18482
550
211