The REST API will provide a way for users to administer a school database containing information about courses: users can interact with the database by retrieving a list of courses, as well as adding, updating and deleting courses in the database.
In addition, the project require users to create an account and log-in to make changes to the database.
Key technologies used: Node.js, Express.js, bcryptjs, Express Validator, SQLite and sequelizejs.
Some of the important files provided by Tree House to aid in the project has been noted below:
- The
seedfolder contains a starting set of data for the database in the form of a JSON file (data.json) and a collection of files (context.js,database.js, andindex.js) that can be used to create the app's database and populate it with data - The
app.jsfile configures Express to serve a simple REST API. It also configured themorgannpm package to log HTTP requests/responses to the console. Note: it is just a starting point and I added to this file and other files with the routes and models for the API - The
nodemon.jsfile configures the nodemon Node.js module, which is used to run the REST API. - The
package.jsonfile (and the associatedpackage-lock.jsonfile) contain the project's npm configuration, which includes the some of the starting project dependencies. - The
RESTAPI.postman_collection.jsonfile is a collection of Postman requests that can be used to test and explore the REST API.
- Download or clone the repository
- Open Terminal in the project directory
- Run
npm installto install dependencies - Run
npm run seedto seed the SQLite database - Run
npm startto start the node application - Use Postman to test the rest api routes at http://localhost:5000/
Note: Requires Node.js and npm