Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Arturo Montejo Ráez
/
WBT2425_0
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
20
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
03e165b4
authored
Apr 15, 2025
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed fallback route
parent
75409e57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
fastapi/main.py
start.sh
fastapi/main.py
View file @
03e165b4
...
...
@@ -11,6 +11,7 @@ from book.schemas import Book # Import Book schema
from
auth
import
is_admin_user
,
is_valid_user
from
fastapi.staticfiles
import
StaticFiles
from
fastapi.responses
import
RedirectResponse
from
fastapi
import
Request
from
config
import
config
app
=
FastAPI
()
...
...
@@ -108,6 +109,6 @@ def login(form_data: OAuth2PasswordRequestForm = Depends(), db: Session = Depend
# Redirect root URL to the public index.html
@app.route
(
"/{full_path:path}"
)
async
def
catch_all
(
full_path
:
str
):
async
def
catch_all
(
request
:
Request
,
full_path
:
str
):
print
(
"full_path: "
+
full_path
)
return
RedirectResponse
(
"/public/index.html"
)
\ No newline at end of file
start.sh
View file @
03e165b4
#!/bin/bash
# Copy React build to FastAPI public directory
cp
-r
react/out/
*
fastapi/public/
# Copy production config to FastAPI config
cp fastapi/config-prod.py fastapi/config.py
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment