1.1.0 • Published 7 years ago

mongo-crest v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

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