MCPcopy Create free account
hub / github.com/developit/express-es6-rest-api / load

Function load

server/api/facets.js:12–16  ·  view source on GitHub ↗

For requests with an `id`, you can auto-load the entity. * Errors terminate the request, success sets `req[id] = data`.

(req, id, callback)

Source from the content-addressed store, hash-verified

10 * Errors terminate the request, success sets `req[id] = data`.
11 */
12 load(req, id, callback) {
13 var facet = facets.find( facet => facet.id===id ),
14 err = facet ? null : 'Not found';
15 callback(err, user);
16 },
17
18 /** GET / - List all entities */
19 index({ params }, res) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected