Helper for getting DNS records. All methods are cached.
- OpenAPI https://dns.madn.top/docs
- Redoc https://dns.madn.top/redoc
Create .env file in project root and set environment variables for application (example: .env.example).
Install requirements:
- Local verision:
pip install -r requirements/local.txt
- Production version:
pip install -r requirements/production.txt
Run the web application:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
You must have docker and docker-compose tools installed to work with material in this section.
- Local version:
docker-compose -f docker-compose-local.yml up -d --build
- Production version:
docker-compose -f docker-compose-production.yml up -d --build
Use kubernetes.yaml and autoscale.yaml
The application will be available on localhost in your browser.
All routes are available on /docs or /redoc paths with Swagger or ReDoc.
Files related to application are in the app or tests directories. Application parts are:
app
├── api - web related stuff.
│ └── endpoints - web routes.
├── core - application configuration, startup events, logging, caching.
├── models - pydantic models for this application.
│ └── schemas - schemas for using in web routes.
├── services - business logic.
└── main.py - FastAPI application creation and configuration.
tests - tests
Content: .pre-commit-config.yaml
pre-commit run --all-files
pre-commit install
- Add different responses for exceptions (resolver.NoAnswer, resolver.NXDOMAIN)
- Add other types of records
Look at directories: scripts, .github.