Spaces:
Build error
Build error
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import uvicorn
|
| 2 |
+
from fastapi import FastAPI
|
| 3 |
+
from fastapi.responses import RedirectResponse
|
| 4 |
+
|
| 5 |
+
app = FastAPI()
|
| 6 |
+
|
| 7 |
+
@app.get('/')
|
| 8 |
+
def redirect():
|
| 9 |
+
return RedirectResponse('/home')
|
| 10 |
+
|
| 11 |
+
@app.get('/home')
|
| 12 |
+
def home():
|
| 13 |
+
return 'Hello world!'
|
| 14 |
+
|
| 15 |
+
uvicorn.run("app:app", host="0.0.0.0", port=7860, log_level="info")
|