Skip to content

Commit

Permalink
v1.13.7 add whoami to coap
Browse files Browse the repository at this point in the history
  • Loading branch information
sqrtofsaturn committed Nov 25, 2015
1 parent ec6d59a commit 6edf207
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions lib/setupCoapRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,20 @@ function setupCoapRoutes(coapRouter, skynet){
subscribeAndForward(fromDevice, res, req.params.uuid, req.params.token, ['sent'], false, req.merged_params.topics);
});
});

// coap get coap://localhost/whoami
coapRouter.get('/whoami', function (req, res) {
authorizeRequest(req, res, function(fromDevice){
skynet.sendActivity(getActivity('whoami', req, fromDevice));
whoAmI(fromDevice.uuid, false, function(results) {
if(results.error){
errorResponse(results.error, res);
}else{
res.json(results);
}
});
});
});
}

module.exports = setupCoapRoutes;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "meshblu-server",
"description": "communications platform and api for iot",
"version": "1.13.6",
"version": "1.13.7",
"author": "Octoblu, Inc.",
"dependencies": {
"@octoblu/redis-ns": "^0.1.1",
Expand Down

0 comments on commit 6edf207

Please sign in to comment.