{"action":"created","issue":{"url":"https://api.github.com/repos/hueniverse/hueniversity/issues/1","labels_url":"https://api.github.com/repos/hueniverse/hueniversity/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/hueniverse/hueniversity/issues/1/comments","events_url":"https://api.github.com/repos/hueniverse/hueniversity/issues/1/events","html_url":"https://github.com/hueniverse/hueniversity/issues/1","id":60704629,"number":1,"title":"Create a basic HTTP server","user":{"login":"hueniverse","id":56631,"avatar_url":"https://avatars.githubusercontent.com/u/56631?v=3","gravatar_id":"","url":"https://api.github.com/users/hueniverse","html_url":"https://github.com/hueniverse","followers_url":"https://api.github.com/users/hueniverse/followers","following_url":"https://api.github.com/users/hueniverse/following{/other_user}","gists_url":"https://api.github.com/users/hueniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/hueniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hueniverse/subscriptions","organizations_url":"https://api.github.com/users/hueniverse/orgs","repos_url":"https://api.github.com/users/hueniverse/repos","events_url":"https://api.github.com/users/hueniverse/events{/privacy}","received_events_url":"https://api.github.com/users/hueniverse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hueniverse/hueniversity/labels/assignment","name":"assignment","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-11T18:15:03Z","updated_at":"2015-03-16T06:43:01Z","closed_at":null,"body":"Let's get started!\r\n\r\nFirst, we need some basic structure: a `lib` folder, a `package.json` file, and an initial `index.js`. Since we will be using **hapi**, we need to include that in the project dependencies.\r\n\r\nSecond, create a basic **hapi** server on port 8000 which responds to `/version` requests and replies with a simple `{ \"version\": \"0.0.1\" }` JSON payload. The version in the response should come from the `package.json` file.\r\n\r\nAssignment due: 3/17\r\n\r\nGot questions or need help? Post a comment."},"comment":{"url":"https://api.github.com/repos/hueniverse/hueniversity/issues/comments/81449836","html_url":"https://github.com/hueniverse/hueniversity/issues/1#issuecomment-81449836","issue_url":"https://api.github.com/repos/hueniverse/hueniversity/issues/1","id":81449836,"user":{"login":"hueniverse","id":56631,"avatar_url":"https://avatars.githubusercontent.com/u/56631?v=3","gravatar_id":"","url":"https://api.github.com/users/hueniverse","html_url":"https://github.com/hueniverse","followers_url":"https://api.github.com/users/hueniverse/followers","following_url":"https://api.github.com/users/hueniverse/following{/other_user}","gists_url":"https://api.github.com/users/hueniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/hueniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hueniverse/subscriptions","organizations_url":"https://api.github.com/users/hueniverse/orgs","repos_url":"https://api.github.com/users/hueniverse/repos","events_url":"https://api.github.com/users/hueniverse/events{/privacy}","received_events_url":"https://api.github.com/users/hueniverse/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T06:43:01Z","updated_at":"2015-03-16T06:43:01Z","body":"General comments:\r\n\r\n- The project structure should follow the same style of every other hapi module. This means `package.json` should include a `main` property that points to either `index.js` or `lib/index.js`. If the project includes a root `index.js`, it must not include any code other than `require('./lib/index.js')`. This makes searching for code easier later as well as keeps the entire application in one spot. I plan to get rid of the root `index.js` file for all the hapi modules I maintain soon as that extra file is useless.\r\n- Most of the submissions had some minors style issues. Pay attention to the empty lines requirement after function declaration as well as not declaring any local variable other than UpperCamelCase required modules and `internals`. See https://gist.github.com/hueniverse/a06f6315ea736ed1b46d for more information.\r\n- While not a worthwhile optimization in this example, there is no reason to have an endpoint that returns a static object response in which that object is constructed every request. The version payload could have been prepared in advance `internals.response = { version: internals.package.version }`.\r\n- If a callback includes an error, check for it! Some of you forgot to check for the error in `server.start(err)`.\r\n- If there is no way to recover from an error and the process should abort, instead of writing custom code to console log it and then exit, just call `Hoek.assert(!err, err)`.\r\n- No need to make up your own `.gitignore`. Just copy it from hapijs/hapi. Also, you only need a root ignore file, not one in every directory.\r\n- When calling a callback interface, better to add `return` before to make it stand out and avoid bugs where the callback is executed and then some more code at an undefined time. In this case, in the handler make sure you call `return reply({ version: internals.package.version });`.\r\n"}}