23 lines
493 B
Markdown
23 lines
493 B
Markdown
# loopback-explorer
|
|
|
|
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);
|
|
|
|
app.use('/api', loopback.rest());
|
|
app.use('/explorer', explorer(app, { basePath: '/api' }));
|
|
|
|
app.listen(3000);
|
|
```
|