-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: allow dynamic routing based on file paths #55
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool feature and work! I have some comments regarding compatibility mainly with Windows, and other minor comments.
All in all, I think despite surprising to have brackets at the filesystem level, it is a useful feature when developing locally and prioritizing fast results.
Co-authored-by: Rafael Fernández López <[email protected]>
…ity than fixed routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 it!
// Default content type | ||
builder.insert_header(("Content-Type", "text/html")); | ||
|
||
for (key, val) in handler_result.headers.iter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is iter() really needed? I think the preferred style is using a reference instead of explicit .iter()
:
https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop.
for (key, val) in handler_result.headers.iter() { | |
for (key, val) in &handler_result.headers { |
Introduce dynamic routes with parameters in files. For example,
[id].wasm
orusers/[id]/show
. The server identifies this pattern in files and configure actix to reply to parametrized URLs.Note that the same
wasm_handler
serves all the requests. This means thatwws
calculates the best worker to reply on every request. The reasons I coded it in that way are:Runner
instances cannot be shared. This will require multiple instances of the same Wasm module, so the resource consumption will be increased.I updated the
Rust
andJavaScript
kits and introduced some new examples so you can see how parameter in URLs works.It closes #10
Pending