Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove route prefix in notebook #235

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions zt_backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@
project_name = settings.project_name
user_name = settings.user_name

route_prefix = ''
if project_name:
route_prefix = '/'+user_name+'/'+project_name

app.include_router(router.router, prefix=route_prefix)
app.mount(route_prefix+"/copilot", copilot_app)
app.include_router(router.router)
app.mount("/copilot", copilot_app)

app.add_middleware(
CORSMiddleware,
Expand Down Expand Up @@ -54,6 +50,6 @@ def open_project():
logger.error("Error creating new files on startup: %s", traceback.format_exc())

if run_mode=='app':
app.mount(route_prefix, StaticFiles(directory=os.path.join(current_path, "dist_app"), html=True), name="assets")
app.mount('', StaticFiles(directory=os.path.join(current_path, "dist_app"), html=True), name="assets")
else:
app.mount(route_prefix, StaticFiles(directory=os.path.join(current_path, "dist_dev"), html=True), name="assets")
app.mount('', StaticFiles(directory=os.path.join(current_path, "dist_dev"), html=True), name="assets")
Loading