/spacebookSV

Spacebook API for the 21/22 MAD Assignment

Primary LanguageJavaScript

Spacebook API

This is the Spacebook API for use in the 21/22 MAD assignment.

To get started, read the assignment brief and attend the assignment lecture.

For queries, contact Ashley Williams (ashley.williams@mmu.ac.uk).

Config

  1. Clone the repository into a directory on your local machine. If you have Git installed on your machine then you can run git clone https://github.com/ash-williams/Spacebook in your terminal
  2. In the root of the cloned repository, create a .env file with your DB config details. The file should look like the following:
DB_HOST=<URL for mudfoot>
DB_PORT=<port number for mudfoot>
DB_USER=<your mudfoot username>
DB_PASS=<your mudfoot password>
  1. Edit the first line in /app/scripts/tables.sql and /app/scripts/dummy_data.sql. Replace ashley_student with your own Mudfoot username.
  2. In the terminal, run npm install to install the dependencies
  3. Copy the contents of the yaml file in the resources directory into editor.swagger.io
  4. Run the server with npm run dev
  5. In Postman, send a POST request to 'http://localhost:3333/api/1.0.0/reset' - this will create your database tables
  6. In Postman, send a POST request to 'http://localhost:3333/api/1.0.0/resample' - this will add the dummy data
  7. Paste the contents of the YAML file in /resources/ into 'http://editor.swagger.io' for documentation on each of the end points
  8. Continue to test everything is working using Postman