From 31aa331da866a358ae4c99b0158be4d3bb579e95 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Mon, 29 Jan 2024 12:50:06 -0500 Subject: [PATCH] Add fastapi.configure --- src/dispatch/fastapi.py | 10 ++++++++++ tests/test_fastapi.py | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/dispatch/fastapi.py diff --git a/src/dispatch/fastapi.py b/src/dispatch/fastapi.py new file mode 100644 index 00000000..b90e1e0f --- /dev/null +++ b/src/dispatch/fastapi.py @@ -0,0 +1,10 @@ +"""Integration of Dispatch programmable endpoints for FastAPI. + +""" + +import fastapi + + +def configure(app: fastapi.FastAPI): + """Configure the FastAPI app to use Dispatch programmable endpoints.""" + ... diff --git a/tests/test_fastapi.py b/tests/test_fastapi.py index 8d8aee3c..aaeb8fd2 100644 --- a/tests/test_fastapi.py +++ b/tests/test_fastapi.py @@ -1,13 +1,16 @@ import unittest import dispatch +import dispatch.fastapi import fastapi from fastapi.testclient import TestClient -class TestFastapi(unittest.TestCase): +class TestFastAPI(unittest.TestCase): def test_fastapi(self): app = fastapi.FastAPI() + dispatch.fastapi.configure(app) + @app.get("/") def read_root(): return {"Hello": "World"}