Skip to content

Conversation

@nyurik
Copy link
Contributor

@nyurik nyurik commented Apr 6, 2017

cleaned up app.js to fix how promises are created/processed.

The old code would throw an exception outside of the promise chain in case of an error in config.

Also, auto-cleaned up the code (spacing, newlines, curly braces)

@Pchelolo
Copy link
Contributor

Pchelolo commented Apr 6, 2017

The test fails on node 6 because it doesn't install peerDependencies any more, so you need to explicitly depend on eslint-plugin-jsdoc and eslint-plugin-json

@Pchelolo
Copy link
Contributor

Pchelolo commented Apr 6, 2017

I didn't look through the internals of the initApp method changes since if you use the P.method it will be way easier to look at.

app.js Outdated
process.env.NO_PROXY = app.conf.no_proxy_list.join(',');
} else {
process.env.NO_PROXY = app.conf.no_proxy_list;
return BBPromise.try(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid a gigantic diff that will not be easy to merge into the services we can leave the initApp function internals untouched and just do const initApp = BBPromise.method(() => ... in the function initialization. That one-liner will have the same effect as this huge diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated it to be exactly as before, but the indent needs to be increased by 4 spaces, or else the eslint will complain

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ye, that's why I'm suggesting the BBPromise.method feature - then you won't need to update the indentation.

app.js Outdated
app.use('/static', express.static(__dirname + '/static'));
return app;
}).then(createServer);
.then(loadRoutes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the code-style where the .then starts on the new line without indentation.

@nyurik nyurik force-pushed the appclean branch 2 times, most recently from 3b9fc58 to 8cec918 Compare April 6, 2017 20:26
@nyurik
Copy link
Contributor Author

nyurik commented Apr 6, 2017

@Pchelolo good catch, I didn't know of BBPromise.method(). Fixed.

@Pchelolo
Copy link
Contributor

Pchelolo commented Apr 6, 2017

LGTM, but not sure why changes from my previous PR are showing up in here, but it should be fine to merge. @d00rman ?

@nyurik
Copy link
Contributor Author

nyurik commented Apr 6, 2017

@Pchelolo because i rebased my changes on top of yours :)

@d00rman
Copy link
Contributor

d00rman commented Nov 9, 2017

LGTM, but (a) needs a rebase; and (b) please do not remove the comment separator lines in function headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants