Skip to content

Commit

Permalink
root redirects to doc page
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart A. Siegel committed Aug 5, 2024
1 parent 9aac4e7 commit df23b5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion services/inference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ make test_image
make start_local_server
```

Then open your browser to http://127.0.0.1:8000/docs, click on the `/openapi.json` link at the top of this page.
Then open your browser to http://127.0.0.1:8000

To stop the server run:

Expand Down
6 changes: 3 additions & 3 deletions services/inference/tsfminference/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

import logging

import starlette.status as status
import yaml
from fastapi import FastAPI
from fastapi.responses import RedirectResponse

from . import (
TSFM_CONFIG_FILE,
Expand Down Expand Up @@ -40,9 +42,7 @@

@app.get("/")
def root():
# Endpoint at the root URL ("/") returns a welcome message with a clickable link
message = "Welcome. Go to /docs to access the API documentation."
return {"message": message}
return RedirectResponse(url="/docs", status_code=status.HTTP_302_FOUND)


if __name__ == "__main__":
Expand Down

0 comments on commit df23b5b

Please sign in to comment.