add fastapi as optional dependency, + first experiments
This commit is contained in:
parent
db1f78f4e6
commit
778324ad33
3 changed files with 16 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ app = [
|
|||
"zope.traversing",
|
||||
]
|
||||
auth = ["pyjwt[crypto]", "cryptography", "requests"]
|
||||
fastapi = ["fastapi[standard]"]
|
||||
test = ["zope.testrunner"]
|
||||
#test = ["pytest"]
|
||||
|
||||
|
|
|
|||
1
scopes/api/__init__.py
Normal file
1
scopes/api/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""package scopes.api"""
|
||||
14
scopes/api/main.py
Normal file
14
scopes/api/main.py
Normal file
|
|
@ -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}
|
||||
|
||||
Loading…
Add table
Reference in a new issue