loopback-component-explorer/example/simple.js

15 lines
363 B
JavaScript
Raw Normal View History

2013-11-05 19:16:59 +00:00
var loopback = require('loopback');
var app = loopback();
var explorer = require('../');
var port = 3000;
2013-11-05 19:16:59 +00:00
var Product = loopback.Model.extend('product');
Product.attachTo(loopback.memory());
app.model(Product);
app.use('/explorer', explorer(app));
app.use(loopback.rest());
console.log("Explorer mounted at localhost:" + port + "/explorer");
2013-11-05 19:16:59 +00:00
app.listen(port);