1.1.0 • Published 8 years ago
mongo-crest v1.1.0
Installation
npm i -g mongo-crestUsage
npm startAbout
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