loopback/example/colors/app.js

20 lines
362 B
JavaScript
Raw Normal View History

2013-05-01 19:11:43 +00:00
var asteroid = require('../../');
var app = asteroid();
app.use(asteroid.rest());
var Color = app.define('color');
Color.defineSchema({
'id': 'Number',
'name': 'String'
});
Color
.create({name: 'red'})
.create({name: 'green'})
.create({name: 'blue'});
app.listen(3000);
console.log('a list of colors is available at http://localhost:300/colors');