Replies: 1 comment 1 reply
-
Agree. I think spinframework/spin-rust-sdk#51 would address what you're asking for. (For some reason I thought we had done this but we haven't so... we should.) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Note: The code/example here is written in Rust.
I am developing based on microservice architecture principles.
When using spin_sdk::http::Router, I need to hard-code the path information to be filtered by the router. For example: link.
However, with these hard-coded router paths, my application becomes much less portable.
To reuse the app (the WASM file) or move it to a different URL/path, I must update the route section in Spin.toml — which makes sense — but I also have to modify the code and recompile it.
If there were a way to access Spin.toml information at runtime, or if the router were smart enough to determine the incoming request paths automatically without requiring the full path to be hard-coded, it would make the app much more flexible and reusable, especially in a microservice architecture.
Current:
Spin.toml
Code:
Prefer:
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions