adding latest
This commit is contained in:
@@ -2,7 +2,10 @@ from fastapi import FastAPI, Header, Path
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
from random import randint
|
||||
from starlette.routing import Route
|
||||
from starlette.templating import Jinja2Templates
|
||||
|
||||
|
||||
templates = Jinja2Templates(directory='templates')
|
||||
|
||||
|
||||
app = FastAPI(
|
||||
@@ -46,11 +49,15 @@ def get_metric_data(
|
||||
}
|
||||
|
||||
|
||||
def test(request):
|
||||
return 'request'
|
||||
def test(*, user_agent=Header(None)):
|
||||
return 's'
|
||||
|
||||
|
||||
app.route('/test', [test])
|
||||
def test1(request):
|
||||
pass
|
||||
|
||||
|
||||
app.add_api_route('/test', endpoint=test, include_in_schema=False)
|
||||
|
||||
|
||||
class Item(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user