In order to remove boot/rest and boot/explorer from the api-server template, we need to extend loopback-boot to support the following features:
-
Specifying middleware parameters as a value to be read via app.get from config.json, example:
{
"routes": {
"loopback#rest": {
"paths": ["${restApiRoot}"]
}
}
-
Allowing the middleware to be optional, e.g.
{
"routes": {
"loopback-explorer": {
"optional": "Run `npm install loopback-explorer` to enable the LoopBack explorer.",
"params": {
"basePath": "$!{restApiRoot}"
}
}
}
-
Rework the explorer so that it can get the app object via req.app on the first request, in the same way as loopback.rest.
In order to remove
boot/restandboot/explorerfrom the api-server template, we need to extend loopback-boot to support the following features:Specifying middleware parameters as a value to be read via
app.getfromconfig.json, example:{ "routes": { "loopback#rest": { "paths": ["${restApiRoot}"] } }Allowing the middleware to be optional, e.g.
{ "routes": { "loopback-explorer": { "optional": "Run `npm install loopback-explorer` to enable the LoopBack explorer.", "params": { "basePath": "$!{restApiRoot}" } } }Rework the explorer so that it can get the
appobject viareq.appon the first request, in the same way asloopback.rest.