The backend application is built using such technologies: Express, Postgres, Sequelize, Docker and implements the principles of REST API.
API for CRUD operations of users is created:
- Ability to create a user.
- Ability to get all users.
- Ability to get users of a specified role.
- Ability to update user data.
- Ability to delete a user.
To test the API, you need to use the URL: http://localhost:3000/api
.
In the repository is a JSON file with a Postman collection for ease of testing.
- GET /users - To get all users.
- POST /users - To add a user.
- GET /users?role=admin - To get a user with a specified role.
- GET /users/:userId - To get a user by id.
- PUT /users/:userId - To update a user by id.
- DELETE /users/:userId - To delete a user by id.
- Make sure you have Docker installed on your computer. Download and install if necessary.
- Start docker-container with the
docker-compose up
command - To stop the container, use the
docker-compose down
command.