Package Exports
- keystone-rest
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (keystone-rest) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
keystone-rest
Expose keystone lists via REST api.
Documentation
http://danielpquinn.github.io/keystone-rest
Usage
var keystone = require('keystone'),
Types = keystone.Field.Types,
keystoneRest = require('keystone-rest');
var User = new keystone.List('User');
// Add 'restSelected: false' to hide from api
// Add 'restEditable: false' to disallow editing field via PUT
User.add({
name: { type: Types.Name, required: true, index: true },
password: { type: Types.Password, initial: true, required: false, restSelected: false },
token: { type: String, restEditable: false }
});
// Expose User model via REST api
keystoneRest.addRoutes(User, 'get post put delete');
User.register();
// Add routes to app
keystoneRest.registerRoutes(app);