MCPcopy Index your code
hub / github.com/WebThingsIO/webthing-node / get

Method get

lib/server.ts:421–429  ·  view source on GitHub ↗

* Handle a GET request. * * @param {Object} req The request object * @param {Object} res The response object

(req: express.Request, res: express.Response)

Source from the content-addressed store, hash-verified

419 * @param {Object} res The response object
420 */
421 get(req: express.Request, res: express.Response): void {
422 const thing = this.getThing(req);
423 if (thing === null) {
424 res.status(404).end();
425 return;
426 }
427
428 res.json(thing.getActionDescriptions());
429 }
430
431 /**
432 * Handle a POST request.

Callers 1

constructorMethod · 0.95

Calls 2

getActionDescriptionsMethod · 0.80
getThingMethod · 0.45

Tested by

no test coverage detected