UNPKG

express-autoroute-json

Version:

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

15 lines (13 loc) 302 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: {}, });