Training project: Simple web hosting portal using microservices on Flask
- Make virtual environment and activate
pip install -r requirements.txt- In users_service/application/const.py set
DB_URI - run
python manage.py setup_dbin users_service/ - run
python manage.py runin users_service/ - repeat
3-5steps for servers_service and rent_service - run
python manage.py runin gateway_service/
root URI = http://localhost:8080
| URI | METHOD | Description | Body parameters | Parameters | Status codes |
|---|---|---|---|---|---|
| /server?page={page}&size={size} | GET | Get servers with pagination | - | page, size(optional) | 200, 400, 404 |
| /server/{id} | GET | Get info about server | - | id | 200, 400, 404 |
| /user/{id}/rent | POST | Create rent for user | server_id, duration | id | 201, 400, 404, 422 |
| /user/{id}/rent | GET | Get rents for user | - | id | 200, 400, 404 |
| /user/{user_id}/rent/{rent_id} | DELETE | Delete user's rent | - | user_id, rent_id | 204, 400, 404 |