Simple version of stackoverflow.
- Python 3.6+
- Docker
- Django
- PosgreSQL
To start execute command:
docker-compose up
After building tests run. If tests passed successfully server starts at the 80 port at container. Container's port 80 maps at 8000 port at localhost. You can start using server at http://localhost:8000/
Return all questions with pagination
GET /api/questions/?page=1&page_size
Parameter | Type | Description |
---|---|---|
page |
integer |
Page number |
page_size |
integer |
Number of questions by page. Default: 20 |
Return question details
GET /api/questions/<id>
Return all question answers with pagination
GET /api/questions/<id>/answers?page=1&page_size
Parameter | Type | Description |
---|---|---|
page |
integer |
Page number |
page_size |
integer |
Number of answers by page. Default: 20 |
Return 20 most popular questions
GET /api/questions/trending
Return all questions sorted by create date with pagination
GET /api/questions/new
Parameter | Type | Description |
---|---|---|
page |
integer |
Page number |
page_size |
integer |
Number of answers by page. Default: 20 |
Return all questions sorted by vote count with pagination
GET /api/questions/hot
Parameter | Type | Description |
---|---|---|
page |
integer |
Page number |
page_size |
integer |
Number of answers by page. Default: 20 |
Return swagger scheme. Without format parameter return UI scheme
GET /api/swagger
Parameter | Type | Description |
---|---|---|
format |
string |
Format type: .json |
Documentation
GET /api/redoc
Tests run automatically after container build. If you want to run them manually use
python3 manage.py test