- Clone the repository by typing
git clone https://github.com/angelware10110/kas-vyksta-tavo-mieste.git
in console - Download Postman
- Download Node.js
- Install npm packages by typing
npm install
in console
Type npm run demon
in console to start the project
- Open Postman
- Click New and select HTTP Request
- Select the POST method
- Type
http://localhost:6655/api/users/
in the request URL - Click Body below the request URL and select raw
- On the right click Text and select JSON
- In body paste the following text and replace the required fields:
{
"email": "example@email.com",
"name": "John Doe",
"password": "your_password"
}
- Click Send
- Copy the string after "token": for later
- Follow the same steps as Registration up to the 6th step
- Replace the request URL with
http://localhost:6655/api/users/login
- In body paste the following text and replace the required fields:
{
"email": "example@email.com",
"password": "your_password"
}
- Click Send
- Copy the string after "token": for later
- Open Postman
- Click New and select HTTP Request
- Select the GET method
- Type
http://localhost:6655/api/events/
in the request URL
- Follow the same steps as Registration up to the 6th step
- Replace the request URL with
http://localhost:6655/api/events/
- In body paste the following text and replace the required fields:
{
"host": "your_user_ID",
"email": "example@email.com",
"event_location": "your_event_location",
"event_date": "your_event_date",
"event_duration": "your_event_duration"
}
- Click Headers left to the Body
- Write
Authorization
in the Key field - Write
Bearer your_copied_token
in the Value field - Click Send
- Follow the same steps as Registration up to the 6th step
- Instead of the POST method select the PUT method
- Replace the request URL with
http://localhost:6655/api/events/
- Add your event ID to the request URL, example:
http://localhost:6655/api/events/6400bda8526d8000fd9d9656
- In body paste the following text and replace the required fields:
{
"host": "your_user_ID",
"email": "example@email.com",
"event_location": "your_edited_event_location",
"event_date": "your_edited_event_date",
"event_duration": "your_edited_event_duration"
}
- Click Headers left to the Body
- Write
Authorization
in the Key field - Write
Bearer your_copied_token
in the Value field - Click Send
- Follow the same steps as Registration up to the 6th step
- Instead of the POST method select the DELETE method
- Replace the request URL with
http://localhost:6655/api/events/
- Add your event ID to the request URL, example:
http://localhost:6655/api/events/6400bda8526d8000fd9d9656
- Click Headers left to the Body
- Write
Authorization
in the Key field - Write
Bearer your_copied_token
in the Value field - Click Send