GagarinAPI is a simple API providing facts about Yuri Gagarin, the first human in space. It uses Flask for the backend, MongoDB for data storage, and Docker for containerization. Basic API tests are included to verify functionality.
- Random fact about Yuri Gagarin.
- Retrieve all facts.
- Fetch random facts by category (e.g., "space", "biography").
- Dockerized for easy deployment.
- Includes API tests for validation.
-
Clone the repository:
git clone https://github.com/SadLiter/GagarinAPI.git cd GagarinAPI -
Build and run with Docker Compose:
docker-compose up --build
-
Access the API:
The API will be running athttp://localhost:5000. -
Run tests: To run the tests for the API:
pytest
- GET /random_fact: Get a random fact about Yuri Gagarin.
- GET /all_facts: Get all facts.
- GET /random_fact_by_category?category=: Get a random fact by category (e.g., "space", "biography").
- Flask: Python web framework.
- MongoDB: Database for storing facts.
- Docker: Containerization.
- pytest: For testing the API.