Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var ModelDef = app.model('model-definition', {dataSource: DEFAULT_DATASOURCE});
var DataSourceDef = app.model('datasource-definition', {dataSource: DEFAULT_DATASOURCE});
var AppDef = app.model('app-definition', {dataSource: DEFAULT_DATASOURCE});
// relationships
Project.hasMany('models', {model: ModelDef});
Project.hasMany('dataSources', {model: DataSourceDef});
// model extensions
require('./models/project');
require('./models/model-definition');
require('./models/datasource-definition');
// server middleware
app.use(loopback.favicon());
app.use(loopback.logger('dev'));
app.use(loopback.bodyParser());
app.use(loopback.methodOverride());
app.use(app.router);
// development only
if ('development' == app.get('env')) {
app.use(loopback.errorHandler());
}
// only start the server if this module
// is the main module...
if(require.main === module) {
app.listen();
}
/*
* 1. Configure LoopBack models and datasources
*
* Read more at http://apidocs.strongloop.com/loopback#appbootoptions
*/
app.boot(__dirname);
/*
* 2. Configure request preprocessing
*
* LoopBack support all express-compatible middleware.
*/
app.use(loopback.favicon());
app.use(loopback.logger(app.get("env") === "development" ? "dev" : "default"));
app.use(loopback.cookieParser(app.get("cookieSecret")));
app.use(loopback.token({model: app.models.accessToken}));
app.use(loopback.json());
app.use(loopback.urlencoded());
app.use(loopback.methodOverride());
app.use(loopback.static(path.join(__dirname, "public")));
/*
* EXTENSION POINT
* Add your custom request-preprocessing middleware here.
* Example:
* app.use(loopback.limit('5.5mb'))
*/
/*
* 3. Setup request handlers.
/*
* 1. Configure LoopBack models and datasources
*
* Read more at http://apidocs.strongloop.com/loopback#appbootoptions
*/
app.boot(__dirname);
/*
* 2. Configure request preprocessing
*
* LoopBack support all express-compatible middleware.
*/
app.use(loopback.favicon());
app.use(loopback.logger(app.get('env') === 'development' ? 'dev' : 'default'));
app.use(loopback.cookieParser(app.get('cookieSecret')));
app.use(loopback.token({model: app.models.accessToken}));
app.use(loopback.bodyParser());
app.use(loopback.methodOverride());
/*
* EXTENSION POINT
* Add your custom request-preprocessing middleware here.
* Example:
* app.use(loopback.limit('5.5mb'))
*/
/*
* 3. Setup request handlers.
*/
/*
* 1. Configure LoopBack models and datasources
*
* Read more at http://apidocs.strongloop.com/loopback#appbootoptions
*/
app.boot(__dirname);
/*
* 2. Configure request preprocessing
*
* LoopBack support all express-compatible middleware.
*/
app.use(loopback.favicon());
app.use(loopback.logger(app.get('env') === 'development' ? 'dev' : 'default'));
app.use(loopback.cookieParser(app.get('cookieSecret')));
app.use(loopback.token({model: app.models.accessToken}));
app.use(loopback.bodyParser());
app.use(loopback.methodOverride());
/*
* EXTENSION POINT
* Add your custom request-preprocessing middleware here.
* Example:
* app.use(loopback.limit('5.5mb'))
*/
/*
* 3. Setup request handlers.
*/
/*
* 1. Configure LoopBack models and datasources
*
* Read more at http://apidocs.strongloop.com/loopback#appbootoptions
*/
app.boot(__dirname);
/*
* 2. Configure request preprocessing
*
* LoopBack support all express-compatible middleware.
*/
app.use(loopback.favicon());
app.use(loopback.logger(app.get('env') === 'development' ? 'dev' : 'default'));
app.use(loopback.cookieParser(app.get('cookieSecret')));
app.use(loopback.token({model: app.models.accessToken}));
app.use(loopback.bodyParser());
app.use(loopback.methodOverride());
/*
* EXTENSION POINT
* Add your custom request-preprocessing middleware here.
* Example:
* app.use(loopback.limit('5.5mb'))
*/
/*
* 3. Setup request handlers.
*/
/*
* 1. Configure LoopBack models and datasources
*
* Read more at http://apidocs.strongloop.com/loopback#appbootoptions
*/
app.boot(__dirname);
/*
* 2. Configure request preprocessing
*
* LoopBack support all express-compatible middleware.
*/
app.use(loopback.favicon());
app.use(loopback.logger(app.get('env') === 'development' ? 'dev' : 'default'));
app.use(loopback.cookieParser(app.get('cookieSecret')));
app.use(loopback.token({model: app.models.accessToken}));
app.use(loopback.bodyParser());
app.use(loopback.methodOverride());
/*
* EXTENSION POINT
* Add your custom request-preprocessing middleware here.
* Example:
* app.use(loopback.limit('5.5mb'))
*/
/*
* 3. Setup request handlers.
*/
/*
* 1. Configure LoopBack models and datasources
*
* Read more at http://apidocs.strongloop.com/loopback#appbootoptions
*/
app.boot(__dirname);
/*
* 2. Configure request preprocessing
*
* LoopBack support all express-compatible middleware.
*/
app.use(loopback.favicon());
app.use(loopback.logger(app.get('env') === 'development' ? 'dev' : 'default'));
app.use(loopback.cookieParser(app.get('cookieSecret')));
app.use(loopback.token({model: app.models.accessToken}));
app.use(loopback.bodyParser());
app.use(loopback.methodOverride());
/*
* EXTENSION POINT
* Add your custom request-preprocessing middleware here.
* Example:
* app.use(loopback.limit('5.5mb'))
*/
/*
* 3. Setup request handlers.
*/