{"action":"created","issue":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/1301","labels_url":"https://api.github.com/repos/nodeschool/discussions/issues/1301/labels{/name}","comments_url":"https://api.github.com/repos/nodeschool/discussions/issues/1301/comments","events_url":"https://api.github.com/repos/nodeschool/discussions/issues/1301/events","html_url":"https://github.com/nodeschool/discussions/issues/1301","id":95502385,"number":1301,"title":"Help with learnyounode exercise 13","user":{"login":"konejoo387","id":13038865,"avatar_url":"https://avatars.githubusercontent.com/u/13038865?v=3","gravatar_id":"","url":"https://api.github.com/users/konejoo387","html_url":"https://github.com/konejoo387","followers_url":"https://api.github.com/users/konejoo387/followers","following_url":"https://api.github.com/users/konejoo387/following{/other_user}","gists_url":"https://api.github.com/users/konejoo387/gists{/gist_id}","starred_url":"https://api.github.com/users/konejoo387/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konejoo387/subscriptions","organizations_url":"https://api.github.com/users/konejoo387/orgs","repos_url":"https://api.github.com/users/konejoo387/repos","events_url":"https://api.github.com/users/konejoo387/events{/privacy}","received_events_url":"https://api.github.com/users/konejoo387/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-16T18:59:33Z","updated_at":"2015-07-17T02:20:21Z","closed_at":"2015-07-17T02:20:21Z","body":"Cant figure out this part:\r\n\r\n\"Add second endpoint for the path 'api/unixtime' wich accepts the same query string but returns UNIX epoch time in milliseconds\"\r\n\r\nI know that the require('url').parse(request.url , true) returns: \r\n\r\n{\r\nprotocol: null,\r\nslashes: null,\r\n.\r\n.\r\n.\r\npathname: '/api/parsetime',\r\npath: 'api/parsetime?iso=2015-07-16T00:41:51.101Z',\r\nhref: 'api/parsetime?iso=2015-07-16T00:41:51.101Z' }\r\n\r\ni dont know where to add the \"second endpoint\". I've already have that unix time in a variable but dont know how to proceed, here's my code:\r\n______________________________________________________________\r\nvar http = require('http');\r\n\r\nhttp.createServer( function(request , response){\r\n\t\r\n\tif(request.method != \"GET\"){\r\n\t\treturn response.end('Send me a GET!');\r\n\t}\r\n\telse {\r\n\r\n\t\tvar path  = require('url').parse(request.url , true).pathname;\r\n\t\tvar q     = require('url').parse(request.url , true).query.iso; \r\n\t\t\r\n\t\tvar date = new Date(q);\r\n\t\tvar unix = date.getTime();\r\n\t\t\r\n\t\tvar J = {\r\n\t\t\t\r\n\t\t\t\"hour\"   : date.getHours(),\r\n\t\t\t\"minute\" : date.getMinutes(),\r\n\t\t\t\"second\" : date.getSeconds()\r\n\t\t\t\r\n\t\t} \r\n\r\n\t\tvar U = {\r\n\t\t\t\"unixtime\" : unix\r\n\t\t}\r\n\t\t\r\n\t\tresponse.writeHead(200, {\r\n\t\t\t'Content-Type': 'text/plain' \r\n\t\t});\r\n\t\t\r\n\t\tresponse.end(JSON.stringify(J));\r\n\t\t//console.log(require('url').parse(request.url));\r\n\t}\r\n\r\n}).listen(process.argv[2]);\r\n______________________________________________________________________\r\n*.- And i'm confused because it gives me this output in the console... twice:\r\n\r\n{\"hour\":11,\"minute\":51,\"second\":20}\r\n{\"hour\":11,\"minute\":51,\"second\":20}"},"comment":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/comments/122151074","html_url":"https://github.com/nodeschool/discussions/issues/1301#issuecomment-122151074","issue_url":"https://api.github.com/repos/nodeschool/discussions/issues/1301","id":122151074,"user":{"login":"SomeoneWeird","id":665754,"avatar_url":"https://avatars.githubusercontent.com/u/665754?v=3","gravatar_id":"","url":"https://api.github.com/users/SomeoneWeird","html_url":"https://github.com/SomeoneWeird","followers_url":"https://api.github.com/users/SomeoneWeird/followers","following_url":"https://api.github.com/users/SomeoneWeird/following{/other_user}","gists_url":"https://api.github.com/users/SomeoneWeird/gists{/gist_id}","starred_url":"https://api.github.com/users/SomeoneWeird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SomeoneWeird/subscriptions","organizations_url":"https://api.github.com/users/SomeoneWeird/orgs","repos_url":"https://api.github.com/users/SomeoneWeird/repos","events_url":"https://api.github.com/users/SomeoneWeird/events{/privacy}","received_events_url":"https://api.github.com/users/SomeoneWeird/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T02:20:21Z","updated_at":"2015-07-17T02:20:21Z","body":":+1: "}}