Skip to content

Commit

Permalink
Merge pull request #169 from Steinbeck-Lab/dev-chandu
Browse files Browse the repository at this point in the history
fix: updated base path redirect to /docs page and terms link update
  • Loading branch information
CS76 authored Jun 5, 2023
2 parents d0de8ab + f3882ae commit a27f94f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from fastapi import FastAPI
from fastapi import FastAPI, HTTPException
from fastapi.responses import RedirectResponse
from fastapi_versioning import VersionedFastAPI
from fastapi.routing import APIRoute

# from .config import settings
from .routers import chem, converters, decimer
Expand All @@ -9,7 +10,7 @@
app = FastAPI(
title="Cheminf Micro Services",
description="This set of essential and valuable microservices is designed to be accessed via API calls to support cheminformatics. Generally, it is designed to work with SMILES-based inputs and could be used to translate between different machine-readable representations, get Natural Product (NP) likeliness scores, visualize chemical structures, and generate descriptors. In addition, the microservices also host an instance of STOUT and another instance of DECIMER (two deep learning models for IUPAC name generation and optical chemical structure recognition, respectively).",
terms_of_service="https://github.com/Steinbeck-Lab",
terms_of_service="https://steinbeck-lab.github.io/cheminformatics-python-microservice",
contact={
"name": "Steinbeck Lab",
"url": "https://cheminf.uni-jena.de/",
Expand All @@ -35,17 +36,12 @@
app.include_router(converters.router)
app.include_router(decimer.router)


@app.get("/", include_in_schema=False)
async def docs_redirect():
return RedirectResponse(url="/docs")


app = VersionedFastAPI(
app,
version_format="{major}",
prefix_format="/v{major}",
terms_of_service="https://github.com/Steinbeck-Lab",
enable_latest=True,
terms_of_service="https://steinbeck-lab.github.io/cheminformatics-python-microservice",
contact={
"name": "Steinbeck Lab",
"url": "https://cheminf.uni-jena.de/",
Expand All @@ -56,3 +52,7 @@ async def docs_redirect():
"url": "https://creativecommons.org/licenses/by/4.0/",
},
)

@app.get("/", include_in_schema=False)
async def root():
return RedirectResponse(url="/docs")

0 comments on commit a27f94f

Please sign in to comment.