{"action":"created","comment":{"url":"https://api.github.com/repos/anthill/pheromon/pulls/comments/43260798","id":43260798,"diff_hunk":"@@ -189,19 +189,51 @@ module.exports = function(app, debug){\n \n     // complex queries\n \n-    app.get('/currentPlaceMeasurements/:type', function(req, res){\n+    // get latest measurement of one type for one place\n+    app.get('/placeLatestMeasurement/:place/:type', function(req, res){\n         var type = req.params.type;\n+        var place = req.params.place;\n \n-        database.complexQueries.currentPlaceMeasurements(type)\n+        database.complexQueries.placeLatestMeasurement(place, type)\n         .then(function(data){\n             res.status(200).send(data);\n         })\n         .catch(function(error){\n-            console.log('error in /currentPlaceMeasurements', error);\n-            res.status(500).send('Couldn\\'t get current live affluence database');\n+            console.log('error in /placeLatestMeasurement', error);\n+            res.status(500).send('Error in /placeLatestMeasurement/:place/:type');\n         });\n     });\n \n+    // get latest measurement of one type for all places\n+    app.get('/placesLatestMeasurement/:type', function(req, res){","path":"api/routes.js","position":24,"original_position":24,"commit_id":"22ebd3af8489935b5edecd01a8d3e9cd49f0676d","original_commit_id":"22ebd3af8489935b5edecd01a8d3e9cd49f0676d","user":{"login":"iOiurson","id":8417814,"avatar_url":"https://avatars.githubusercontent.com/u/8417814?v=3","gravatar_id":"","url":"https://api.github.com/users/iOiurson","html_url":"https://github.com/iOiurson","followers_url":"https://api.github.com/users/iOiurson/followers","following_url":"https://api.github.com/users/iOiurson/following{/other_user}","gists_url":"https://api.github.com/users/iOiurson/gists{/gist_id}","starred_url":"https://api.github.com/users/iOiurson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iOiurson/subscriptions","organizations_url":"https://api.github.com/users/iOiurson/orgs","repos_url":"https://api.github.com/users/iOiurson/repos","events_url":"https://api.github.com/users/iOiurson/events{/privacy}","received_events_url":"https://api.github.com/users/iOiurson/received_events","type":"User","site_admin":false},"body":"Since `/placesLatestMeasurement` and `sensorsLatestMeasurement` don't do exactly the same kind of thing (the former gets measurements for ALL places, whereas the latter gets measurement for SOME sensors).\r\nMaybe call the first one `allPlacesLatestMeasurement` ?","created_at":"2015-10-28T14:21:26Z","updated_at":"2015-10-28T14:21:26Z","html_url":"https://github.com/anthill/pheromon/pull/64#discussion_r43260798","pull_request_url":"https://api.github.com/repos/anthill/pheromon/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/anthill/pheromon/pulls/comments/43260798"},"html":{"href":"https://github.com/anthill/pheromon/pull/64#discussion_r43260798"},"pull_request":{"href":"https://api.github.com/repos/anthill/pheromon/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/anthill/pheromon/pulls/64","id":49007460,"html_url":"https://github.com/anthill/pheromon/pull/64","diff_url":"https://github.com/anthill/pheromon/pull/64.diff","patch_url":"https://github.com/anthill/pheromon/pull/64.patch","issue_url":"https://api.github.com/repos/anthill/pheromon/issues/64","number":64,"state":"open","locked":false,"title":"New endpoints for 6element","user":{"login":"vallettea","id":371303,"avatar_url":"https://avatars.githubusercontent.com/u/371303?v=3","gravatar_id":"","url":"https://api.github.com/users/vallettea","html_url":"https://github.com/vallettea","followers_url":"https://api.github.com/users/vallettea/followers","following_url":"https://api.github.com/users/vallettea/following{/other_user}","gists_url":"https://api.github.com/users/vallettea/gists{/gist_id}","starred_url":"https://api.github.com/users/vallettea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vallettea/subscriptions","organizations_url":"https://api.github.com/users/vallettea/orgs","repos_url":"https://api.github.com/users/vallettea/repos","events_url":"https://api.github.com/users/vallettea/events{/privacy}","received_events_url":"https://api.github.com/users/vallettea/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-28T13:47:42Z","updated_at":"2015-10-28T14:21:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0bf0820b511c4672f811405d33b0bbda95f8a16c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/anthill/pheromon/pulls/64/commits","review_comments_url":"https://api.github.com/repos/anthill/pheromon/pulls/64/comments","review_comment_url":"https://api.github.com/repos/anthill/pheromon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/anthill/pheromon/issues/64/comments","statuses_url":"https://api.github.com/repos/anthill/pheromon/statuses/22ebd3af8489935b5edecd01a8d3e9cd49f0676d","head":{"label":"vallettea:master","ref":"master","sha":"22ebd3af8489935b5edecd01a8d3e9cd49f0676d","user":{"login":"vallettea","id":371303,"avatar_url":"https://avatars.githubusercontent.com/u/371303?v=3","gravatar_id":"","url":"https://api.github.com/users/vallettea","html_url":"https://github.com/vallettea","followers_url":"https://api.github.com/users/vallettea/followers","following_url":"https://api.github.com/users/vallettea/following{/other_user}","gists_url":"https://api.github.com/users/vallettea/gists{/gist_id}","starred_url":"https://api.github.com/users/vallettea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vallettea/subscriptions","organizations_url":"https://api.github.com/users/vallettea/orgs","repos_url":"https://api.github.com/users/vallettea/repos","events_url":"https://api.github.com/users/vallettea/events{/privacy}","received_events_url":"https://api.github.com/users/vallettea/received_events","type":"User","site_admin":false},"repo":{"id":42448649,"name":"pheromon","full_name":"vallettea/pheromon","owner":{"login":"vallettea","id":371303,"avatar_url":"https://avatars.githubusercontent.com/u/371303?v=3","gravatar_id":"","url":"https://api.github.com/users/vallettea","html_url":"https://github.com/vallettea","followers_url":"https://api.github.com/users/vallettea/followers","following_url":"https://api.github.com/users/vallettea/following{/other_user}","gists_url":"https://api.github.com/users/vallettea/gists{/gist_id}","starred_url":"https://api.github.com/users/vallettea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vallettea/subscriptions","organizations_url":"https://api.github.com/users/vallettea/orgs","repos_url":"https://api.github.com/users/vallettea/repos","events_url":"https://api.github.com/users/vallettea/events{/privacy}","received_events_url":"https://api.github.com/users/vallettea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vallettea/pheromon","description":"","fork":true,"url":"https://api.github.com/repos/vallettea/pheromon","forks_url":"https://api.github.com/repos/vallettea/pheromon/forks","keys_url":"https://api.github.com/repos/vallettea/pheromon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vallettea/pheromon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vallettea/pheromon/teams","hooks_url":"https://api.github.com/repos/vallettea/pheromon/hooks","issue_events_url":"https://api.github.com/repos/vallettea/pheromon/issues/events{/number}","events_url":"https://api.github.com/repos/vallettea/pheromon/events","assignees_url":"https://api.github.com/repos/vallettea/pheromon/assignees{/user}","branches_url":"https://api.github.com/repos/vallettea/pheromon/branches{/branch}","tags_url":"https://api.github.com/repos/vallettea/pheromon/tags","blobs_url":"https://api.github.com/repos/vallettea/pheromon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vallettea/pheromon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vallettea/pheromon/git/refs{/sha}","trees_url":"https://api.github.com/repos/vallettea/pheromon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vallettea/pheromon/statuses/{sha}","languages_url":"https://api.github.com/repos/vallettea/pheromon/languages","stargazers_url":"https://api.github.com/repos/vallettea/pheromon/stargazers","contributors_url":"https://api.github.com/repos/vallettea/pheromon/contributors","subscribers_url":"https://api.github.com/repos/vallettea/pheromon/subscribers","subscription_url":"https://api.github.com/repos/vallettea/pheromon/subscription","commits_url":"https://api.github.com/repos/vallettea/pheromon/commits{/sha}","git_commits_url":"https://api.github.com/repos/vallettea/pheromon/git/commits{/sha}","comments_url":"https://api.github.com/repos/vallettea/pheromon/comments{/number}","issue_comment_url":"https://api.github.com/repos/vallettea/pheromon/issues/comments{/number}","contents_url":"https://api.github.com/repos/vallettea/pheromon/contents/{+path}","compare_url":"https://api.github.com/repos/vallettea/pheromon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vallettea/pheromon/merges","archive_url":"https://api.github.com/repos/vallettea/pheromon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vallettea/pheromon/downloads","issues_url":"https://api.github.com/repos/vallettea/pheromon/issues{/number}","pulls_url":"https://api.github.com/repos/vallettea/pheromon/pulls{/number}","milestones_url":"https://api.github.com/repos/vallettea/pheromon/milestones{/number}","notifications_url":"https://api.github.com/repos/vallettea/pheromon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vallettea/pheromon/labels{/name}","releases_url":"https://api.github.com/repos/vallettea/pheromon/releases{/id}","created_at":"2015-09-14T12:57:27Z","updated_at":"2015-09-14T12:57:28Z","pushed_at":"2015-10-28T13:46:53Z","git_url":"git://github.com/vallettea/pheromon.git","ssh_url":"git@github.com:vallettea/pheromon.git","clone_url":"https://github.com/vallettea/pheromon.git","svn_url":"https://github.com/vallettea/pheromon","homepage":null,"size":465,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"anthill:master","ref":"master","sha":"49151226c35f1b039af54723aa786da3ae9e04d6","user":{"login":"anthill","id":7281593,"avatar_url":"https://avatars.githubusercontent.com/u/7281593?v=3","gravatar_id":"","url":"https://api.github.com/users/anthill","html_url":"https://github.com/anthill","followers_url":"https://api.github.com/users/anthill/followers","following_url":"https://api.github.com/users/anthill/following{/other_user}","gists_url":"https://api.github.com/users/anthill/gists{/gist_id}","starred_url":"https://api.github.com/users/anthill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthill/subscriptions","organizations_url":"https://api.github.com/users/anthill/orgs","repos_url":"https://api.github.com/users/anthill/repos","events_url":"https://api.github.com/users/anthill/events{/privacy}","received_events_url":"https://api.github.com/users/anthill/received_events","type":"Organization","site_admin":false},"repo":{"id":42229949,"name":"pheromon","full_name":"anthill/pheromon","owner":{"login":"anthill","id":7281593,"avatar_url":"https://avatars.githubusercontent.com/u/7281593?v=3","gravatar_id":"","url":"https://api.github.com/users/anthill","html_url":"https://github.com/anthill","followers_url":"https://api.github.com/users/anthill/followers","following_url":"https://api.github.com/users/anthill/following{/other_user}","gists_url":"https://api.github.com/users/anthill/gists{/gist_id}","starred_url":"https://api.github.com/users/anthill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anthill/subscriptions","organizations_url":"https://api.github.com/users/anthill/orgs","repos_url":"https://api.github.com/users/anthill/repos","events_url":"https://api.github.com/users/anthill/events{/privacy}","received_events_url":"https://api.github.com/users/anthill/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/anthill/pheromon","description":"Deploy, administrate and harvest data from a swarm of sensors","fork":false,"url":"https://api.github.com/repos/anthill/pheromon","forks_url":"https://api.github.com/repos/anthill/pheromon/forks","keys_url":"https://api.github.com/repos/anthill/pheromon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anthill/pheromon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anthill/pheromon/teams","hooks_url":"https://api.github.com/repos/anthill/pheromon/hooks","issue_events_url":"https://api.github.com/repos/anthill/pheromon/issues/events{/number}","events_url":"https://api.github.com/repos/anthill/pheromon/events","assignees_url":"https://api.github.com/repos/anthill/pheromon/assignees{/user}","branches_url":"https://api.github.com/repos/anthill/pheromon/branches{/branch}","tags_url":"https://api.github.com/repos/anthill/pheromon/tags","blobs_url":"https://api.github.com/repos/anthill/pheromon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anthill/pheromon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anthill/pheromon/git/refs{/sha}","trees_url":"https://api.github.com/repos/anthill/pheromon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anthill/pheromon/statuses/{sha}","languages_url":"https://api.github.com/repos/anthill/pheromon/languages","stargazers_url":"https://api.github.com/repos/anthill/pheromon/stargazers","contributors_url":"https://api.github.com/repos/anthill/pheromon/contributors","subscribers_url":"https://api.github.com/repos/anthill/pheromon/subscribers","subscription_url":"https://api.github.com/repos/anthill/pheromon/subscription","commits_url":"https://api.github.com/repos/anthill/pheromon/commits{/sha}","git_commits_url":"https://api.github.com/repos/anthill/pheromon/git/commits{/sha}","comments_url":"https://api.github.com/repos/anthill/pheromon/comments{/number}","issue_comment_url":"https://api.github.com/repos/anthill/pheromon/issues/comments{/number}","contents_url":"https://api.github.com/repos/anthill/pheromon/contents/{+path}","compare_url":"https://api.github.com/repos/anthill/pheromon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anthill/pheromon/merges","archive_url":"https://api.github.com/repos/anthill/pheromon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anthill/pheromon/downloads","issues_url":"https://api.github.com/repos/anthill/pheromon/issues{/number}","pulls_url":"https://api.github.com/repos/anthill/pheromon/pulls{/number}","milestones_url":"https://api.github.com/repos/anthill/pheromon/milestones{/number}","notifications_url":"https://api.github.com/repos/anthill/pheromon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anthill/pheromon/labels{/name}","releases_url":"https://api.github.com/repos/anthill/pheromon/releases{/id}","created_at":"2015-09-10T07:41:08Z","updated_at":"2015-09-29T13:39:17Z","pushed_at":"2015-10-28T13:47:42Z","git_url":"git://github.com/anthill/pheromon.git","ssh_url":"git@github.com:anthill/pheromon.git","clone_url":"https://github.com/anthill/pheromon.git","svn_url":"https://github.com/anthill/pheromon","homepage":"","size":768,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":16,"forks":4,"open_issues":16,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/anthill/pheromon/pulls/64"},"html":{"href":"https://github.com/anthill/pheromon/pull/64"},"issue":{"href":"https://api.github.com/repos/anthill/pheromon/issues/64"},"comments":{"href":"https://api.github.com/repos/anthill/pheromon/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/anthill/pheromon/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/anthill/pheromon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/anthill/pheromon/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/anthill/pheromon/statuses/22ebd3af8489935b5edecd01a8d3e9cd49f0676d"}}}}