re: Note App - Part 1: Setup the Node API VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Your code is wonderful and comprehensive. I have one question.. What is the purpose of 'cors' you used in index.js? Thank you.
 

'cors' is needed if we're going to use the API from a different domain or port. Without 'cors' we won't be able to connect the API to any other apps, like the React app we're going to develop in the next post. As far as running the API in just this post, 'cors' isn't needed. Hope that helps!

 
code of conduct - report abuse