Skip to content

Conversation

@pinto8
Copy link

@pinto8 pinto8 commented May 30, 2018

No description provided.

Copy link

@Kamalnrf Kamalnrf left a comment

Choose a reason for hiding this comment

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

✔️ What went well:


  • I like the function you wrote for errors
  • Migrations and seeds are also good
  • Commit messages are also good

🎗️ Recommendation(s):


  • Instead of having duplicate code for bad requests you can write a middleware to do that work.
  • It is better to isolate all your explicit database changes in a different file like dataHelper.js so your API code looks cleaner and easy to maintain.
  • Use a logger like morgan or any other


## What is Node.js?

* Node.js is a JavaScript run-time environment that includes everything you need to execute a program written in JavaScript. It allows JS to run within the browser.

Choose a reason for hiding this comment

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

Node.js allows JS to run outside of the browser


module.exports = router;

const sendUserError = (msg, res) => {

Choose a reason for hiding this comment

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

I like this, you could have written a middleware instead.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants