-
Notifications
You must be signed in to change notification settings - Fork 192
[assignment 2] Convert version route to plugin #44
Conversation
|
||
// Register plugin | ||
exports.register = function (server, options, next) { | ||
server.route({ |
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.
newline after function
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.
got it!
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.
👍
bb0485c
to
462de95
Compare
} | ||
}); | ||
|
||
next(); |
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.
This is a callback so return
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.
Good call!
462de95
to
c0d9d04
Compare
Do we want to check if the version is a valid semver? |
@Sschuck the version comes from |
var internals = {}; | ||
|
||
var internals = { | ||
version: require('./version') |
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.
This is odd. Just var Version = require('./version');
at the top and then use that in register()
.
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.
updated
8ae937a
to
6961d7f
Compare
@@ -2,35 +2,25 @@ | |||
|
|||
var Hapi = require('hapi'); | |||
var Hoek = require('hoek'); | |||
var Package = require('../package.json'); | |||
|
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.
No empty line here.
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.
In personal projects I have always put a new line between modules that are included from node_modules
and modules that are being included locally from the project.
That aside the style has been fixed.
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.
I also like to do this, makes it easier to see what are local modules
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.
I just sort them: node, npm, local.
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.
Reasonable... I follow the same pattern (with spaces).
Thanks for taking the tie to discuss
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.
same sorting here only with newlines in between
6961d7f
to
dc5005c
Compare
[assignment 2] Convert version route to plugin
Closes #43