/express-back-end-hackathon

w4d5_build-a-back-end-hackathon-craig

Primary LanguageJavaScript

Week 4 Hackathon

Build a backend using REST principles

At the end of our fourth week on the School of Code bootcamp, we were tasked with creating a simple backend using Node.js and Express.js. This project only has a half functioning frontend, so please instead view the files within the router and models folders.

We had to create a route for each of the CRUD operations - Create, Read, Update and Delete - that queried local data stored in a separate JS file.

As a pair we had to install express and create a router and then configure it to run at a certain endpoint path. We used REST principles to first create our routes and then abstract the actual logic out to a separate models file. We used Postman to test that our routes were working and provided the data we expected. We also used console logs to further verify the data. Additionally we started implementing this with our frontend.

This exercise taught me about writing JS in the backend, using a package manager (npm) to manage modules (such as express), and how to build a simple REST Api that can be used to fetch data from the frontend.

Credits: Craig Summers and Abdullatif Farah