foo@bar:~/PageTurner
npm install
- This has to be done the first time you pull the repository.
- How to follow the Git conventions of this project can be found here
Host: localhost:4000/api/author End-points:
- localhost:4000/api/author : You will GET all authors
- localhost:4000/api/author/fullname/"name" : You will GET an author by fullname
- localhost:4000/api/author/"id" : You will get an author by id
- POST: localhost:4000/api/"author" : adds an author to mongoDB. Needs a json body to be sent.
- localhost:4000/api/author/"id" : You DELETE an author by id
- localhost:4000/api/author/fullname/"name" : You DELETE an author by fullname. Note you have to remove the: "" and insert your value of choice.
First of all one has to make sure that they have the correct MongoDb link at .env and you have access to the mongoDB. Please contact younesb for invite.
Next, cd into the backend folder. In this folder we have 3 ways of running the server.
foo@bar:~/PageTurner/backend
node server.js
foo@bar:~/PageTurner/backend
nodemon server.js
foo@bar:~/PageTurner/backend
npm run dev
We recommend using method 2 or 3.
For testing the end-points listed above at "Primitive Backend documentation" we recommend using Postman.
endring