Skip to content

Commit

Permalink
feat: showcase new demo on home (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgarel authored Jun 28, 2024
1 parent 3c9052c commit 1cb9cdd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
from typing import Annotated, Any, cast

import elasticsearch
import starlette.status as status
from elasticsearch_dsl import Search
from fastapi import Body, FastAPI, HTTPException, Query, Request, Response
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse, PlainTextResponse
from fastapi.responses import HTMLResponse, PlainTextResponse, RedirectResponse
from fastapi.templating import Jinja2Templates
from pydantic import ValidationError

Expand Down Expand Up @@ -199,6 +200,11 @@ def taxonomy_autocomplete(


@app.get("/", response_class=HTMLResponse)
def off_demo():
return RedirectResponse(url="/static/off.html", status_code=status.HTTP_302_FOUND)


@app.get("/off-test", response_class=HTMLResponse)
def html_search(
request: Request,
q: str | None = None,
Expand Down

0 comments on commit 1cb9cdd

Please sign in to comment.