IRESTFUL
Gerador de RESTFul para NodeJS
Instalação e Configuração
npm install irestful
//Configure and Start iRESTFulirestful.start;
Insert
Method: POST or PUT URL: http://localhost:port/REST/FooSchema Parametros: - foofield - barfield Return:{ "Meta": , "Count":Number, "Result" : Object {..} }
Update
- Necessario passar o parametro _id
Method: POST or PUT URL: http://localhost:port/REST/FooSchema Parametros: - _id - barfield Return:{ "Meta": , "Count":Number, "Result" : Object {..} }
Delete
Method: DELETE or GET DELETE: http://localhost:port/REST/FooSchema/ObjectID GET: http://localhost:port/REST/FooSchema/ObjectID/delete Return:{ "Meta": , "DeletedObject" : Object {..} }
Search
Method: GET URL: http://localhost:port/REST/FooSchema Parametros: - search - populate - limit - page Return:{ "Meta": , "Count":Number, "Result" : Object {..} }
Autenticação
Method: GET É necessario um registro na Collection AuthAPI para utilizar a autenticação de acesso Nesse modelo:
No NodeJS
var express = require, http = require, path = require, app = mongoose = require irestful = require; var Schema = mongoose.Schema mongoose.connect; //Configure and Start iRESTFulirestful.start; http.createServer.listen;
License
MIT
Free Software, Hell Yeah!