UNPKG

express-autoroute-json

Version:

Express Auto Route Json is an automatic JSON 'REST' api builder for express-autoroute

16 lines (14 loc) 316 B
var autorouteJson = require('../../../'); var Project = require('../../models/project')(); module.exports.autoroute = autorouteJson({ model: Project, resource: 'pear', translateId(id, req) { if (id === 'me') { return req.query.createdProject; } return id; }, find: {}, update: {}, });