loopback/example/colors/app.js

19 lines
341 B
JavaScript
Raw Normal View History

2013-05-01 19:11:43 +00:00
var asteroid = require('../../');
var app = asteroid();
app.use(asteroid.rest());
2013-05-24 14:59:23 +00:00
var Color = app.model('color');
2013-05-01 19:11:43 +00:00
Color.defineSchema({
2013-05-24 14:59:23 +00:00
'name': String
2013-05-01 19:11:43 +00:00
});
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');