Initial commit
This commit is contained in:
51
README.md
Normal file
51
README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Hotspot API
|
||||
|
||||
Backend FastAPI per riconoscimento e matching hotspot europei.
|
||||
|
||||
## Endpoints
|
||||
|
||||
| Metodo | Endpoint | Descrizione |
|
||||
|--------|----------|-------------|
|
||||
| GET | `/` | Info servizio |
|
||||
| GET | `/health` | Health check |
|
||||
| GET | `/hotspots` | Lista tutti gli hotspot |
|
||||
| GET | `/hotspots/{id}` | Singolo hotspot |
|
||||
| POST | `/match` | Cerca corrispondenza per testo |
|
||||
| POST | `/reload` | Ricarica database JSON |
|
||||
|
||||
## Esempio chiamata /match
|
||||
|
||||
```bash
|
||||
curl -X POST "https://api.tuodominio.com/match" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"text": "Brussels", "language": "en"}'
|
||||
```
|
||||
|
||||
Risposta:
|
||||
```json
|
||||
{
|
||||
"found": true,
|
||||
"hotspot_id": "1",
|
||||
"name": "Brussels",
|
||||
"confidence": 1.0,
|
||||
"video_ids": [133]
|
||||
}
|
||||
```
|
||||
|
||||
## Deploy su Coolify
|
||||
|
||||
1. Crea un nuovo progetto
|
||||
2. Add Resource → Docker Image o Git repository
|
||||
3. Se usi Git, punta al repo con questo codice
|
||||
4. Configura il volume: `/data` → persistent storage
|
||||
5. Carica `hotspots.json` in `/data/`
|
||||
6. Deploy!
|
||||
|
||||
## Aggiornare il database
|
||||
|
||||
1. Carica il nuovo `hotspots.json` via SFTP in `/data/`
|
||||
2. Chiama `POST /reload` oppure fai redeploy
|
||||
|
||||
## Documentazione API
|
||||
|
||||
Dopo il deploy, visita `/docs` per la documentazione Swagger interattiva.
|
||||
Reference in New Issue
Block a user