loopback-component-server-admin
Adds server administrative tasks to a Loopback server
Setup
component-config.json
Add the following:
{
...
"loopback-component-server-admin": {
"mountPath": "/server"
}
...
}
server.js
When you setup your server, you will need to capture the HTTP Server and save it in the app:
// Bootstrap the application, configure models, datasources and middleware.
// Sub-apps like REST API are mounted via boot scripts.
boot(app, __dirname, function(err) {
if (err) {
throw err;
}
// start the server if `$ node server.js`
if (require.main === module) {
app.server = app.start();
}
});