This is a simple FastAPI application that simulates DoorDash's delivery fee calculation service. It provides three endpoints to calculate delivery fees, estimate delivery time, and check the service status.
- GET / - Welcome message
- POST /calculate-fee/ - Calculate delivery fee based on distance and weight
- GET /estimate-time/{distance_km} - Estimate delivery time based on distance
- GET /status/ - Check the service status
-
Build the Docker image:
docker build -t doordash/delivery-fee-service .
-
Run the Docker container:
docker run -d -p 8080:8080 doordash/delivery-fee-service
-
Access the application:
- Go to
http://localhost:8080
for the welcome message. - Use
/calculate-fee/
to calculate fees,/estimate-time/{distance_km}
to estimate delivery times, and/status/
to check the status.
- Go to
{
"distance_km": 10.5,
"weight_kg": 2.0
}
{
"delivery_fee": 22.75
}