moved to connect-rest 2.0 - #86
Open
imrefazekas wants to merge 1 commit into
Open
Conversation
|
@imrefazekas thanks for jumping here and making the changes. I'm sure @EthanRBrown will be happy too since he's working on the next edition of his book. A couple of comments about this commit.
Again, thank you so much for jumping in and helping make the book even better and helping readers like myself leverage the updates. |
EthanRBrown
requested changes
Mar 14, 2017
| }; | ||
|
|
||
| var Rest = require('connect-rest'); | ||
| let rest = Rest.create( apiOptions ) |
Owner
There was a problem hiding this comment.
Why let here and var above? I'm all about const these days, but this book was written before it was easy to do all of that without transcompilation. This will all be pretty significantly different in the 2nd edition. Also, I'm not fond of unnecessary identifiers...other than calling create, you don't use Rest anywhere else. So I would write this as:
const rest = require('connect-rest').create({ context: '' })
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear Ethan,
I moved the code to connect-rest 2.0. The very minimal to make it work, test ran without error.