FacultyAPI
FacultyAPI creates a simple, RESTful API for MEAN stack apps.
Use:
npm install faculty-api
or in your package.json "faculty-api":"~0.1.0"
Create a Mongoose model, and export it to your backend app.js
.
A basic use case is illustrated below:
var express = ;var app = moduleexports = ;var db = ;var facultyApi = ; facultyApi;
The only non-required option is the URL prefix, which defaults to api if you don't specify one.
In the example above, the URLs established are located at /api/users/:id
, and include an additional route, /api/users/schema
in case you want access to schema attributes for things like front-end validations.