AbstikaAI / README.md
Balaji Gite
Updated code
f650505
|
Raw History Blame Contribute Delete
1.43 kB
---
title: AbstikaTestLLM
emoji: 🐨
colorFrom: blue
colorTo: pink
sdk: docker
pinned: false
license: mit
---
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
# FastAPI Sample Project
This is a simple FastAPI application with sample GET and POST endpoints for testing.
## Features
- **GET /**: Returns a greeting message.
- **POST /items/**: Accepts a JSON body with `name` and `description` fields and returns the item.
## Requirements
- Python 3.9+
- [FastAPI](https://fastapi.tiangolo.com/)
- [Uvicorn](https://www.uvicorn.org/)
## Installation & Running Locally
1. Install dependencies:
```bash
pip install -r requirements.txt
```
2. Start the server:
```bash
uvicorn main:app --reload
```
3. Open your browser at [http://127.0.0.1:8000](http://127.0.0.1:8000)
## API Examples
### GET /
```bash
curl http://127.0.0.1:8000/
```
### POST /items/
```bash
curl -X POST "http://127.0.0.1:8000/items/" -H "Content-Type: application/json" -d '{"name": "Sample Item", "description": "A test item."}'
```
## Docker Usage
1. Build the Docker image:
```bash
docker build -t fastapi-sample .
```
2. Run the container:
```bash
docker run -p 7860:7860 fastapi-sample
```
3. The app will be available at [http://localhost:7860](http://localhost:7860)
---
For more information, see the [FastAPI documentation](https://fastapi.tiangolo.com/).