Skip to content

Commit 927f8b9

Browse files
committed
Update README, add __init__.py, and modify API base URL in index.html
1 parent fc18009 commit 927f8b9

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
---
2+
title: Farmingo API
3+
emoji: 🌾
4+
colorFrom: green
5+
colorTo: blue
6+
sdk: docker
7+
pinned: false
8+
license: mit
9+
short_description: Farmingo API (FastAPI) deployed as a Docker Space.
10+
---
11+
12+
113
## Files
214

315
* `api.py` — main FastAPI application. Must define `app = FastAPI()` at module level and expose the inference endpoint.

api/__init__.py

Whitespace-only changes.

api/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# Internal imports
2121

22-
from schema import (
22+
from api.schema import (
2323
CropPriceInput,
2424
CropPriceOutput,
2525
WeatherSoilData,
@@ -28,9 +28,9 @@
2828
DiseaseResponse
2929
)
3030

31-
from authorization import validate_api_key
31+
from api.authorization import validate_api_key
3232

33-
from logic import (
33+
from api.logic import (
3434
reverse_geocode_state,
3535
fetch_open_meteo,
3636
compute_features,

api/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h2>Farmingo Crop Recommendation</h2>
1313
<pre id="error" style="color:red;"></pre>
1414

1515
<script>
16-
const API_BASE = "http://127.0.0.1:8000";
16+
const API_BASE = "https://swapcodes-farmingo.hf.space";
1717

1818
function log(msg) {
1919
document.getElementById("log").textContent += msg + "\n";

0 commit comments

Comments
 (0)