FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
FastAPI-backend/main.py at main · VansRouges/FastAPI-backend · GitHub
VansRouges
/
FastAPI-backend
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
FastAPI-backend
/
main.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
11 lines (9 loc) · 367 Bytes
Breadcrumbs
FastAPI-backend
/
main.py
Copy path
File metadata and controls
11 lines (9 loc) · 367 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
from
fastapi
import
FastAPI
,
Request
from
fastapi
.
responses
import
RedirectResponse
app
=
FastAPI
()
@
app
.
get
(
"/"
)
async
def
get_ip_and_redirect
(
request
:
Request
):
ip
=
request
.
client
.
host
# Option 1: Pass IP to Streamlit as query param
streamlit_url
=
f"https://web-production-db93.up.railway.app?ip=
{
ip
}
"
return
RedirectResponse
(
url
=
streamlit_url
)
Back
|
FazBrowse Home
|
New Git URL