Loopback-explorer loads express and strong-remoting from loopback's `node_modules` folder. This fails when one of those dependencies was installed to the parent project, e.g. as a peer dependency. app/node_modules +- express # <- express installed as peer to loopback +- loopback +- node_modules # <- express is not there As of this commit, loopback-explorer will retry the `require()` call without `loopback/node_modules` prefix if the first require fails. 1. `require('loopback/node_modules/express')` 2. `require('express')` The change should fix (some of) unit-tests failures in https://github.com/strongloop/loopback-workspace |
||
---|---|---|
example | ||
public | ||
test | ||
.gitignore | ||
LICENSE | ||
README.md | ||
index.js | ||
package.json |
README.md
loopback-explorer
Browse and test your LoopBack app's APIs.
Basic Usage
Below is a simple LoopBack application. The explorer is mounted at /explorer
.
var loopback = require('loopback');
var app = loopback();
var explorer = require('loopback-explorer');
var Product = loopback.Model.extend('product');
Product.attachTo(loopback.memory());
app.model(Product);
app.use(loopback.rest());
app.use('/explorer', explorer(app));
app.listen(3000);