y12studio / y12io

online service evaluation
Apache License 2.0
4 stars 0 forks source link

Redstone Rest Route #9

Closed y12studio closed 10 years ago

y12studio commented 10 years ago

luizmineo/redstone.dart

loopback example code

var Item;
var app;
app.model(Item);
app.use('/api', loopback.rest());
app.listen(8080);
// REST API
DELETE /items/{id}
GET /items
GET /items/count
GET /items/findOne
GET /items/{id}
GET /items/{id}/exists
POST /items
PUT /items
PUT /items/{id}
// ADD explorer function to /api
var explorer = require('loopback-explorer');
app.use('/explorer', explorer(app, {basePath: '/api'}));

bloodless

class  Item {
  String title;
  int value;
  Item(this.title, this.value);
}

@app.Route("/api")
restfun(){
   app.model(item);
   app.model(foo);
}

main() {
  app.setupConsoleLog();
  app.start();
}

ref