Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Redirect old registry landing pgae to new one but leave API standing …
Browse files Browse the repository at this point in the history
…for now
  • Loading branch information
ml-evs committed May 28, 2024
1 parent f68cccd commit afaa7a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions marda_registry/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import mongomock as pymongo
import uvicorn
from fastapi import FastAPI, HTTPException, Request
from fastapi import FastAPI, HTTPException, Request, RedirectResponse
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
Expand All @@ -19,7 +19,7 @@

app = FastAPI(
title="MaRDA extractors registry API",
description=f"This server implements v{__api_version__} of the [MaRDA extractors WG](https://github.com/marda-alliance/metadata_extractors) registry API.", # noqa: E501
description=f"This server implements v{__api_version__} of the [MaRDA extractors WG](https://github.com/marda-alliance/metadata_extractors) registry API, please visit yard.datatractor.org instead.", # noqa: E501
version=__api_version__,
)

Expand Down Expand Up @@ -180,8 +180,7 @@ def get_info():

@app.get("/", response_class=HTMLResponse)
def get_index_html(request: Request):
"""Simply return the file types list as the "homepage" for now."""
return templates.TemplateResponse("index.html", {"request": request})
return RedirectResponse("https://yard.datatractor.org", status_code=301)


@lru_cache(maxsize=1)
Expand Down

0 comments on commit afaa7a9

Please sign in to comment.