(q: str)
| 26 | |
| 27 | @app.get('/search', response_model=list[CharName]) # <6> |
| 28 | async def search(q: str): # <7> |
| 29 | chars = sorted(app.state.index.search(q)) |
| 30 | return ({'char': c, 'name': name(c)} for c in chars) # <8> |
| 31 | |
| 32 | @app.get('/', response_class=HTMLResponse, include_in_schema=False) |
| 33 | def form(): # <9> |