-
Notifications
You must be signed in to change notification settings - Fork 192
[Assignment #1]: Basic HTTP Server #3
Changes from 3 commits
d5a5acf
bcb0ee1
9dfc023
a31611d
574d6e3
0dbf4a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.DS_STORE | ||
*.ipr | ||
*.iml | ||
*.iws | ||
web/ | ||
lib/*.zip | ||
version.properties | ||
.sass-cache | ||
swagger-ui.sublime-workspace | ||
.idea | ||
.project | ||
node_modules/* | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var Hapi = require('hapi'); | ||
var packageJSON = require('./package.json'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is better put as a key inside an var internals = {
version: require('./package.json').version
}; See style guide for more information about the use of |
||
|
||
var server = new Hapi.Server(); | ||
server.connection({ port: 8000 }); | ||
|
||
server.route({ | ||
method: 'GET', | ||
path: '/version', | ||
config: { | ||
handler: function (request, reply) { | ||
return reply({ version: packageJSON.version }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New line after function declaration. |
||
} | ||
} | ||
}); | ||
|
||
server.start(function () { | ||
console.log('Server running at:', server.info.uri); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should check for |
||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Super bike sheddy, but I'm a stickler for white space. You might want to add an extra line here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay I will do it.. but may I suggest we might use EditorConfig to unify the coding style ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/editorconfig/editorconfig/wiki/Newline-at-End-of-File-Support Fairly supported and a good idea Here is an example one we can iterate from if you like --> https://github.com/Famous/famous/blob/develop/.editorconfig There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Standard linting rules for Hapi can be found in Lab https://github.com/hapijs/lab/tree/master/lib/linters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eslint / jscs doesn't create the functionality that an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true but it does add some 'restrictions' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guys, Do I need to do anything more here or it's now fine ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assignment is due 17/3 and your PR will be closed either by being merged or probably be closed by @hueniverse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah cool thanks a lot There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a new line at the end of files |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "hueniversity", | ||
"version": "0.0.1", | ||
"description": "Assignment One", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/muhammad-saleh/hueniversity.git" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remember that once this is merged, it will be in this repo, not your fork. The package.json should reflect that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done... Please check the last commit when you have time |
||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/muhammad-saleh/hueniversity/issues" | ||
}, | ||
"homepage": "https://github.com/muhammad-saleh/hueniversity", | ||
"dependencies": { | ||
"hapi": "^8.3.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We like to copy the same ignore file for all hapi project and keep the consistent. Worth looking at hapijs/hapi to see what's in there.