REST API for Hotel data using FastAPI
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints. Learn more about it on the official page
Database built on MongoDB, using pydantic classes as schema and data validation for the NoSQL DB.
- Usual python stuff
- Create virtual env with
virtualenv venv - Activate the same with
source venv/bin/activate - Install dependencies with
pip3 install -r requirements.txt - Create a mongo cluster, or start a local mongodb server and set its url in
.envin the formatDB_URL = "http://localhost:27017" - Start the server with the command
uvicorn API:app --reload - The server will be running at http://localhost:8000
- Visit
http://localhost:8000/docsfor the Swagger UI which helps in listing and instantly testing endpoints out
