Easiest API Framework Layer w/ Database agnostic ORM
Painless API Creation Framework for Node.js w/ Database Agnostic Adapters.
npm install destination
Include the Destination Framework
var Destination = require'destination';
Install an Adapter, and start an objective:
var Objective = Destinationstart/* Express Application (app, generally) */name: 'adapter name such as (mongodb)'Adapter Settings;
Start defining objective Models, Property schema curtesy of Validator.
var User = Objectivedefine'User'// Definition is a collection?//// When collection is a string... it is used as the collection name// rather than the name passed above.//// Example://// collection: 'users',//collection: true// Routing Systemrouting:fetch: by: 'name'fetchAll: falsecreate: trueupdate: falseremove: false// Some more complex, built in:// Update or Createupsert: false// Remove all entriesempty: false// Count of all entriescount: false// Validator Schemaname:type: Stringlength:min: 3max: 24password:type: Stringlength:min: 3max: 36;
Models currently only have two keywords in the root document:
Anything else is used as a property schema, processed and parsed by Validator upon requests, refer to validator for schema documentation.
It's extremely simple. I promise. Now you listen:
You don't even have to use the Objective variable to listen, you can use your application framework to do it and it will still work. :)
- destination-mongodb by Nijikokun
- Find a way to support any application framework instead of Express.