Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
|
3 |
+
app = FastAPI()
|
4 |
+
|
5 |
+
@app.get("/")
|
6 |
+
def home():
|
7 |
+
return {"message": "Welcome to my FastAPI app on HF Spaces!"}
|
8 |
+
|
9 |
+
@app.get("/hello/{name}")
|
10 |
+
def say_hello(name: str):
|
11 |
+
return {"message": f"Hello, {name}!"}
|