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_db
in users_service/ - run
python manage.py run
in users_service/ - repeat
3-5
steps for servers_service and rent_service - run
python manage.py run
in 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 |