Spaces:
Sleeping
Sleeping
title: Drishti Backend API | |
emoji: 🌱 | |
colorFrom: green | |
colorTo: yellow | |
sdk: docker | |
pinned: true | |
# Backend API | |
This directory contains the source code for the backend API, built using FastAPI. | |
## Endpoints | |
This API is hosted at [https://arpy8-drishti-api.hf.space/](https://arpy8-drishti-api.hf.space/). The API provides the following endpoints: | |
- `/predict`: This endpoint takes an image in base64 format as input and returns the predicted disease type. | |
- `/update-data`: Adds the data to the queue which will update the database later. | |
- `/fetch-news`: Fetches the latest news from the news API. | |
- `/last-data`: Fetches last n data logs from the database. | |
## Setup | |
Using the provided Dockerfile, you can easily build and run the API container. | |
1. Build the Docker image: | |
```bash | |
docker build -t backend-api . | |
``` | |
2. Run the Docker container: | |
```bash | |
docker run -p 7860:7860 backend-api | |
``` | |
3. Access the API at `http://localhost:7860/predict`. | |