Skip to content

Instantly share code, notes, and snippets.

@crandmck
Created November 5, 2015 17:23
Show Gist options
  • Save crandmck/0e495329cd1afe7f2f35 to your computer and use it in GitHub Desktop.
Save crandmck/0e495329cd1afe7f2f35 to your computer and use it in GitHub Desktop.
LB2 changes to examples
Since `loopback-explorer` was renamed to `loopback-component-explorer` (see https://github.com/strongloop/loopback-component-explorer/issues/123), we need to propagate this change to the example apps; specifically the same changes made in https://github.com/strongloop/loopback-example-app/pull/79:
**1.** In `package.json`, change
` "loopback-explorer": "^2.0.0",` to `"loopback-component-explorer": "^2.1.0",`
**2.** In `server/component-config.json`, change
```
{
"loopback-explorer": {
"mountPath": "/explorer"
}
}
```
to
```
{
"loopback-component-explorer": {
"mountPath": "/explorer"
}
}
```
NOTE: Many examples will not have `server/component-config.json`, so in that case just add the file.
**3.** In `server/server.js`, change
```
if (app.get('loopback-explorer')) {
var explorerPath = app.get('loopback-explorer').mountPath;
```
to
```
if (app.get('loopback-component-explorer')) {
var explorerPath = app.get('loopback-component-explorer').mountPath;
```
**4.** Remove `server/boot/explorer.js` since it's now done in `component-config.json`.
As long as we're doing, this we might as well also remove `server/boot/rest-api.js` and add the following line to `middleware.json`:
```
"routes": {
"loopback#rest": {
"paths": ["${restApiRoot}"]
},
...
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment