Last active
February 28, 2017 22:14
-
-
Save mbenedettini/18f5623727ce23544c3e780408bdf3cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loopback = require('loopback'); | |
const boot = require('loopback-boot'); | |
const logger = require('logger'); | |
const app = loopback(); | |
// This module resides in /lib so we should boot project from ../server | |
boot(app, __dirname + '/../server'); | |
logger.debug('Loopback initialized'); | |
app.stop = function () { | |
// Disconnect from every data source | |
Object.keys(app.dataSources).forEach(name => { | |
let d = app.dataSources[name]; | |
if (typeof d.disconnect === 'function') { | |
d.disconnect(); | |
} | |
}); | |
}; | |
module.exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment