diff --git a/pyproject.toml b/pyproject.toml index 424f2d0..797aa0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ app = [ "zope.traversing", ] auth = ["pyjwt[crypto]", "cryptography", "requests"] +fastapi = ["fastapi[standard]"] test = ["zope.testrunner"] #test = ["pytest"] diff --git a/scopes/api/__init__.py b/scopes/api/__init__.py new file mode 100644 index 0000000..b5dbf8c --- /dev/null +++ b/scopes/api/__init__.py @@ -0,0 +1 @@ +"""package scopes.api""" diff --git a/scopes/api/main.py b/scopes/api/main.py new file mode 100644 index 0000000..995f986 --- /dev/null +++ b/scopes/api/main.py @@ -0,0 +1,14 @@ +# package scopes.api.main + +from fastapi import FastAPI + +app = FastAPI() + +@app.get('/') +def read_root(): + return {'Hello': 'World'} + +@app.get('/persons/{name}') +def read_person(name: str, q: str | None = None): + return {'name': name, 'query': q} +