Asgi server
When using the asgi app functionality, I'm getting a 404 for everything except the root. Any ideas?
/ works and is a full notebook,
/print-section
gives me a marimo 4045 Replies
What happens when you visit /easy-entry/ (with a slash at the end)
Same thing
If I mount it here:
I also can't visit
/marimo
(404)Ok I figured it out.
This fixed it (I figured it out from looking at the smoke test file: https://github.com/marimo-team/marimo/blob/7a1459dfa5088656b76feeea40fb7109e3f3b221/marimo/_smoke_tests/custom_server/my_server.py
GitHub
marimo/marimo/_smoke_tests/custom_server/my_server.py at 7a1459dfa5...
A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git. - marimo-team/marimo
The fix is to put the index notebook last:
marimo.create_asgi_app()
.with_app(path="/easy-entry", root="./production/easy-entry.py")
.with_app(
path="/print-leader-coverage",
root="./production/print-leader-coverage.py",
)
.with_app(
path="/print-section",
root="./production/print-section.py",
)
.with_app(path="", root="./index.py")
It was matching everything, and so it was index.py's notebook serving that 404
I'm not 100% sure I'd call that a bug, but it'd be worth documenting it here since this example doesn't work: https://docs.marimo.io/guides/deploying/programmatically.html
Thanks again for shipping this though! My users are gonna love it 🙂
oh nice! now that you say that, it makes a lot of sense. i think we should handle this and document it for sure, thanks for debugging this