Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
feat: serve any fastapi app
Browse files Browse the repository at this point in the history
  • Loading branch information
deepankarm committed May 12, 2023
1 parent 204d298 commit c713c5d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions examples/fastapi/endpoints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import Union

from fastapi import FastAPI

app = FastAPI()


@app.get("/status")
def read_root():
return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
6 changes: 3 additions & 3 deletions tests/unit/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_get_jcloud_config(

def test_get_flow_dict_for_local():
flow_dict = get_flow_dict(
module="dummy",
module_str="dummy",
jcloud=False,
is_websocket=False,
)
Expand Down Expand Up @@ -141,14 +141,14 @@ def test_get_flow_dict_for_jcloud(is_websocket, has_config, instance, autoscale_
mocked_open.return_value.__enter__.return_value = io.StringIO(file_content)
with patch("builtins.open", mocked_open):
flow_dict = get_flow_dict(
module="dummy",
module_str="dummy",
jcloud=True,
jcloud_config_path="dummy.yaml",
is_websocket=is_websocket,
)
else:
flow_dict = get_flow_dict(
module="dummy",
module_str="dummy",
jcloud=True,
jcloud_config_path=None,
is_websocket=is_websocket,
Expand Down

0 comments on commit c713c5d

Please sign in to comment.