Merge branch 'main' of https://github.com/unclecode/crawl4ai
This commit is contained in:
6
main.py
6
main.py
@@ -39,6 +39,8 @@ app.add_middleware(
|
|||||||
# Mount the pages directory as a static directory
|
# Mount the pages directory as a static directory
|
||||||
app.mount("/pages", StaticFiles(directory=__location__ + "/pages"), name="pages")
|
app.mount("/pages", StaticFiles(directory=__location__ + "/pages"), name="pages")
|
||||||
app.mount("/mkdocs", StaticFiles(directory="site", html=True), name="mkdocs")
|
app.mount("/mkdocs", StaticFiles(directory="site", html=True), name="mkdocs")
|
||||||
|
app.mount("/", StaticFiles(directory="site", html=True), name="mkdocs")
|
||||||
|
site_templates = Jinja2Templates(directory=__location__ + "/site")
|
||||||
templates = Jinja2Templates(directory=__location__ + "/pages")
|
templates = Jinja2Templates(directory=__location__ + "/pages")
|
||||||
# chromedriver_autoinstaller.install() # Ensure chromedriver is installed
|
# chromedriver_autoinstaller.install() # Ensure chromedriver is installed
|
||||||
@lru_cache()
|
@lru_cache()
|
||||||
@@ -62,10 +64,6 @@ class CrawlRequest(BaseModel):
|
|||||||
verbose: Optional[bool] = True
|
verbose: Optional[bool] = True
|
||||||
|
|
||||||
|
|
||||||
@app.get("/", response_class=HTMLResponse)
|
|
||||||
async def read_index(request: Request):
|
|
||||||
# redirect to site/index.html
|
|
||||||
return templates.TemplateResponse("index.html", {"request": request})
|
|
||||||
|
|
||||||
@app.get("/old", response_class=HTMLResponse)
|
@app.get("/old", response_class=HTMLResponse)
|
||||||
async def read_index(request: Request):
|
async def read_index(request: Request):
|
||||||
|
|||||||
Reference in New Issue
Block a user