Files
ray-project--ray/python/ray/serve/tests/test_config_files/fastapi_deployment.py
T
2026-07-13 13:17:40 +08:00

17 lines
259 B
Python

from fastapi import FastAPI
from ray import serve
app = FastAPI(docs_url="/my_docs")
@serve.deployment
@serve.ingress(app)
class FastAPIDeployment:
@app.get("/hello")
def incr(self):
return "Hello world!"
node = FastAPIDeployment.bind()