Readings: Express Routing & Connected API


Readings: Express Routing & Connected API

How does this change the server’s role

index.js

- Entry Point
- init the DB connection
- fire up the server.js 

server.js

- Hub, gathers everything together.
- import the middleware, routes
- deal with 404 routes and catch error.

models/categories.js, models/products.js

- Data Models defines what the fields need to be created
- type of the entry
- additional settings for data entry

routes/categories.js, etc

- Define routes
- handles routes with different CRUD methods