Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: showcase new demo on home #201

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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