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).
- 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 - 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>
- Edit the first line in
/app/scripts/tables.sql
and/app/scripts/dummy_data.sql
. Replaceashley_student
with your own Mudfoot username. - In the terminal, run
npm install
to install the dependencies - Copy the contents of the yaml file in the resources directory into editor.swagger.io
- Run the server with
npm run dev
- In Postman, send a POST request to 'http://localhost:3333/api/1.0.0/reset' - this will create your database tables
- In Postman, send a POST request to 'http://localhost:3333/api/1.0.0/resample' - this will add the dummy data
- Paste the contents of the YAML file in
/resources/
into 'http://editor.swagger.io' for documentation on each of the end points - Continue to test everything is working using Postman