[Serve] Update front page of serve doc (#11421)

This commit is contained in:
architkulkarni
2020-10-23 12:01:04 -07:00
committed by GitHub
parent 9f804ade5f
commit 1ce0c4965b
3 changed files with 6 additions and 5 deletions
@@ -11,11 +11,12 @@ class Counter:
self.count = 0
def __call__(self, flask_request):
self.count += 1
return {"current_counter": self.count}
client.create_backend("counter", Counter)
client.create_endpoint("counter", backend="counter", route="/counter")
requests.get("http://127.0.0.1:8000/counter").json()
# > {"current_counter": 0}
print(requests.get("http://127.0.0.1:8000/counter").json())
# > {"current_counter": 1}
@@ -13,5 +13,5 @@ def echo(flask_request):
client.create_backend("hello", echo)
client.create_endpoint("hello", backend="hello", route="/hello")
requests.get("http://127.0.0.1:8000/hello").text
# > "hello serve!"
print(requests.get("http://127.0.0.1:8000/hello").text)
# > hello serve!