Skip to content

Commit

Permalink
Added redirect from root endpoint to docs endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
chkim-usgs committed Apr 23, 2024
1 parent 32d6f39 commit a35a59c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fastapi/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Annotated, Any
from fastapi import FastAPI, Query
from pydantic import BaseModel, Field
from starlette.responses import RedirectResponse
import pyspiceql


Expand All @@ -27,7 +28,7 @@ class ResponseModel(BaseModel):
# General endpoints
@app.get("/")
async def root():
return {"message": "Visit the /docs endpoint to see the Swagger UI."}
return RedirectResponse(url="/docs")

@app.post("/customMessage")
async def message(
Expand Down

0 comments on commit a35a59c

Please sign in to comment.