NotThatGuy
NotThatGuy
Mmarimo
Created by NotThatGuy on 12/10/2024 in #help-support
Issues ASGI mount
Thanks for the info! I agree with the linked issue that it relates to absolute / relative path and the mount point of the ASGI app. I'll continue hacking around to mount Marimo routes individually to my main app and report back if I find a solution.
7 replies
Mmarimo
Created by NotThatGuy on 12/10/2024 in #help-support
Issues ASGI mount
Maybe it has something to do with marimo._server.start.start(base_url=...)
7 replies
Mmarimo
Created by NotThatGuy on 12/10/2024 in #help-support
Issues ASGI mount
Issue with create_redirect_to_slash()
import fastapi
import marimo

marimo_server = (
marimo.create_asgi_app()
.with_app(path="/app1", root="marimo_nb.py")
.build()
)

app = fastapi.FastAPI()

# this works
# page found at `localhost:8001/app1`
app.mount("/", app=marimo_server, name="marimo") # this works
uvicorn.run(app, host="localhost", port=8001)

# this doesn't work
# url `localhost:8001/workspace/app1` gets redirected to `localhost:8001/app1` and fails
app.mount("/workspace", app=marimo_server, name="marimo")
uvicorn.run(app, host="localhost", port=8001)
import fastapi
import marimo

marimo_server = (
marimo.create_asgi_app()
.with_app(path="/app1", root="marimo_nb.py")
.build()
)

app = fastapi.FastAPI()

# this works
# page found at `localhost:8001/app1`
app.mount("/", app=marimo_server, name="marimo") # this works
uvicorn.run(app, host="localhost", port=8001)

# this doesn't work
# url `localhost:8001/workspace/app1` gets redirected to `localhost:8001/app1` and fails
app.mount("/workspace", app=marimo_server, name="marimo")
uvicorn.run(app, host="localhost", port=8001)
7 replies