Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
|
| 3 |
+
app = FastAPI()
|
| 4 |
+
|
| 5 |
+
@app.get("/")
|
| 6 |
+
def read_root():
|
| 7 |
+
return {"Hello": "World"}
|
| 8 |
+
|
| 9 |
+
@app.get("/test")
|
| 10 |
+
def test():
|
| 11 |
+
return {"message": "Test endpoint working!"}
|
| 12 |
+
|
| 13 |
+
# This will run when you use: python app.py
|
| 14 |
+
if __name__ == "__main__":
|
| 15 |
+
import uvicorn
|
| 16 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|