2013-11-05 19:24:48 +00:00
|
|
|
# loopback-explorer
|
2013-11-05 17:59:05 +00:00
|
|
|
|
2013-11-05 19:24:48 +00:00
|
|
|
Browse and test your LoopBack app's APIs.
|
|
|
|
|
|
|
|
## Basic Usage
|
|
|
|
|
|
|
|
Below is a simple LoopBack application. The explorer is mounted at `/explorer`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
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);
|
|
|
|
|
2013-12-09 17:12:30 +00:00
|
|
|
app.use('/api', loopback.rest());
|
|
|
|
app.use('/explorer', explorer(app, { basePath: '/api' }));
|
2013-11-05 19:24:48 +00:00
|
|
|
|
|
|
|
app.listen(3000);
|
|
|
|
```
|