Skip to content

Commit 02b13f7

Browse files
committed
feat: add api
1 parent 51096c9 commit 02b13f7

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

ingester/api.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from fastapi import FastAPI, File, UploadFile
2+
from uvicorn import run
3+
4+
app = FastAPI()
5+
6+
7+
@app.post("/")
8+
async def create_file(file: bytes = File()):
9+
with open("import.csv","wb+") as fd:
10+
fd.write(file)
11+
return "ok"
12+
13+
14+
if __name__ == "__main__":
15+
run("api:app",host="0.0.0.0",port=5000,reload=True)

ingester/requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
influxdb==5.3.2
22
gpxpy==1.6.2
3-
lxml==5.2.2
3+
lxml==5.2.2
4+
5+
fastapi==0.110.1
6+
uvicorn==0.29.0
7+
python-multipart==0.0.9

0 commit comments

Comments
 (0)