Create main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI, File, UploadFile
|
| 2 |
+
from fastapi.responses import StreamingResponse
|
| 3 |
+
import os
|
| 4 |
+
import io
|
| 5 |
+
temp = open("model/t.txt","w")
|
| 6 |
+
temp.write("aaaaaaaaaaaaa")
|
| 7 |
+
temp.close()
|
| 8 |
+
|
| 9 |
+
temp = open("model/t.txt","r")
|
| 10 |
+
|
| 11 |
+
app = FastAPI()
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
@app.get("/sample")
|
| 17 |
+
def read_root():
|
| 18 |
+
return {"message": str(temp.read())}
|
| 19 |
+
|