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

Method get

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

634 * @param {Object} res The response object
635 */
636 get(req: express.Request, res: express.Response): void {
637 const thing = this.getThing(req);
638 if (thing === null) {
639 res.status(404).end();
640 return;
641 }
642
643 const eventName = req.params.eventName;
644
645 res.json(thing.getEventDescriptions(eventName));
646 }
647}
648
649/**

Callers 1

constructorMethod · 0.95

Calls 2

getEventDescriptionsMethod · 0.80
getThingMethod · 0.45

Tested by

no test coverage detected