mongo-crest
v1.1.0
Published
A deployable and customizable REST-API server for MongoDB
Downloads
2
Readme
Installation
npm i -g mongo-crest
Usage
npm start
About
A deplyable and customizable REST-API server. The core API functions can be
found in src/
while the schema is in src/schema
. The validator function
in src/validate.coffee
will be ran for every request. This function will
run the request data against the schema.
Schemas
The schemas are simply hash tables of regular expressions. Each field that is being requested will be tested against the regex.
contact =
firstName: /[a-z]{2,32}/i
lastName: /[a-z]{2,32}/i
email: /[a-z0-9\_\-\.]{2,32}@[a-z0-9\_\-\.]{2,32}/i
website: /[a-z0-9\_\-\.]{5,64}/i