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

Method get

lib/server.ts:479–489  ·  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

477 * @param {Object} res The response object
478 */
479 get(req: express.Request, res: express.Response): void {
480 const thing = this.getThing(req);
481 if (thing === null) {
482 res.status(404).end();
483 return;
484 }
485
486 const actionName = req.params.actionName;
487
488 res.json(thing.getActionDescriptions(actionName));
489 }
490
491 /**
492 * Handle a POST request.

Callers 1

constructorMethod · 0.95

Calls 2

getActionDescriptionsMethod · 0.80
getThingMethod · 0.45

Tested by

no test coverage detected