Project containes folders for API and CLIENT. You only need to modify the client side of the project. Open VS Code of the client folder and create the app for the Test.pdf requirements.
npm i
node index.js
npm i
npm start
Login page in which you have two inputs (username, password) and a submit button. Users you can login with:
{
username: "fazi",
password: "1234",
},
{
username: "pera",
password: "1234",
},
{
username: "mika",
password: "1234",
},
{
username: "zika",
password: "1234",
}
Post http://localhost:8000/sessions
{
"username":"zika",
"password": "1234"
}
{
"accessToken": "yuim98oq-e275-45a2-bc2e-b3098036d655"
}
GET http://localhost:8000/tags
GET http://localhost:8000/quotes
GET http://localhost:8000/quotes/:id
POST http://localhost:8000/quotes
POST http://localhost:8000/quotes/:id/upvote
DELETE http://localhost:8000/quotes/:id/upvote
POST http://localhost:8000/quotes/:id/downvote
DELETE http://localhost:8000/quotes/:id/downvote
#Example of the request that uses an accessToken:
const accessToken = "yuim98oq-e275-45a2-bc2e-b3098036d655";
useEffect(() => {
axios
.get("http://localhost:8000/quotes", {
headers: { Authorization: "Bearer " + accessToken },
})
.then((res) => console.log(res))
.catch((err) => console.log);
}, []);