CSE Motors - Kevin`s first express app
The task was to build an app that would allow users to browse a car dealership's inventory, and send messages between users. All handeled with express acting as the router. I used postgres as the database, and hosted the app on Render.com
/* ***********************
* Routes
*************************/
app.use(require('./routes/static'))
// index route
app.get('/', utilities.handleErrors(baseController.buildHome))
// Inventory routes
app.use('/inv', require('./routes/inventoryRoute'))
// Message Routes
app.use('/inbox', require('./routes/inboxRoute'))
// Account routes
app.use('/account', require('./routes/accountRoute'))
This was a difficult project. It taught me how to use the model view controller pattern, and how to use express to handle routing. I also learned how to use postgres to store data. My key takeaway from this project was how hairy an express app could get if you weren't careful. It required extreme care and attention to avoid conflicting page renders.
With great power comes great responsibility and express is extremly powerful. We had to take extreme care not to let our routes get too stringy lest we get lost in the sauce.