Skip to content

Commit

Permalink
Automatically open a browser tab to the app endpoint when running the…
Browse files Browse the repository at this point in the history
… bundled app
  • Loading branch information
anthony2261 committed Apr 23, 2024
1 parent 13479cf commit e2dcb21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions text2sql-backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import uvicorn
from alembic import command
from alembic.config import Config
import webbrowser
from contextlib import asynccontextmanager
from fastapi import Body, Depends, FastAPI, HTTPException, Request, Response
from fastapi.staticfiles import StaticFiles
Expand Down Expand Up @@ -56,6 +57,7 @@ async def lifespan(app: FastAPI):
# On startup
if IS_BUNDLED:
run_migrations()
webbrowser.open("http://localhost:7377", new=2)
yield
# On shutdown

Expand Down

0 comments on commit e2dcb21

Please sign in to comment.