{"repo":"saintedlama/restify-mongoose","free":true,"listed":false,"github":"https://github.com/saintedlama/restify-mongoose","clone":"git clone https://github.com/saintedlama/restify-mongoose.git","description":"Restify-Mongoose provides a resource abstraction to expose mongoose models as REST resources.","language":"JavaScript","stars":109,"topics":["restify","mongoose","javascript","rest-api"],"license":"BSD-2-Clause","category":"api-integrations-sdks","readme_excerpt":"Restify-Mongoose Restify-Mongoose provides a resource abstraction for restify to expose mongoose models as REST resources. Getting started First you'll need to install restify-mongoose via npm npm install restify-mongoose Second step is to wire up mongoose and restify using restify-mongoose Resources To map resources or resource functionality to restify REST endpoints/routes restify-mongoose offers two approaches: 'fine grained mapping' control via list, detail, new, update and delete functions 'quick mapping' via serve method Fine grained mapping In the above getting started example we used fine grained mapping control. Restify-mongoose defines the functions query , detail , insert , update and remove that return restify route handlers and can be used like this: For every ´id´ dependent function the restify route has to define a :id placeholder to allow restify-mongoose to access id parameters. Id dependent functions are detail , update and delete . Query String Setting a queryString will make restify-mongoose use the string as the field name to conduct its searches in the detail update & remove functions. If not set it will use the default behavior of using mongos id field. Quick mapping Maps urls GET '/api/notes' to query function GET '/api/notes/:id' to detail function POST '/api/notes' to insert function DELETE '/api/notes/:id' to remove function PATCH '/api/notes/:id' to update function You can also pass an options object to the serve method to attach handlers before an","default_branch":null,"files":null,"tree":[],"storefront":"/r/saintedlama","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/saintedlama/restify-mongoose/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}