mirror of
https://github.com/wassname/ray.git
synced 2026-07-12 11:20:26 +08:00
14 lines
235 B
Python
14 lines
235 B
Python
from ray import serve
|
|
import requests
|
|
|
|
serve.init()
|
|
|
|
|
|
@serve.route("/hello")
|
|
def echo(flask_request):
|
|
return "hello " + flask_request.args.get("name", "serve!")
|
|
|
|
|
|
requests.get("http://127.0.0.1:8000/hello").text
|
|
# > "hello serve!"
|