Problem
This site: https://github.com/ivanschuetz/swaplink
works correctly when ran locally (as per readme's instructions).
Routes:
pub enum AppRoute {
#[to = "/submit/{}"]
Submit(String),
#[to = "/"]
Generate,
}
When deploying to a remote server, the /submit/{} route doesn't work anymore:
http://swaplink.xyz/submit/sdfs
Uncaught SyntaxError: Unexpected token '<'
Root still works:
http://swaplink.xyz
I was told to add this code: https://github.com/yewstack/yew/blob/0.18.0/examples/router/src/switch.rs#L21-L88
Which I did in this branch: https://github.com/ivanschuetz/swaplink/pull/1
With the only effect that now locally the routing for /submit/{} also doesn't work (differently to the remote server here it shows "Route doesn't match" on the UI (or similar, don't remember the exact wording).
I tried to debug the issue by copy pasting my code into the yew example, and it works there. Maybe it's related with the fact that I'm using wasm-pack (I need it because of an npm dependency)?
Environment:
- Yew version: v0.18
- Rust version: 1.54.0
- Build tool, if relevant: see repo: npm, wasm-pack plugin.
I doubt that it's relevant, but just in case this is my nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /srv/sites/swaplink;
index index.html;
try_files $uri $uri/submit /index.html;
}
where /srv/sites/swaplink contains the files generated in the dist folder (as per readme).
With another server, e.g:
python -m http.server 3000
it shows 404:
http://swaplink.xyz:3000/submit/sdsf
Root works:
http://swaplink.xyz:3000
Questionnaire
* I don't really have time but if it's a must to fix it quickly I can look into it, with some guidance.
Problem
This site: https://github.com/ivanschuetz/swaplink
works correctly when ran locally (as per readme's instructions).
Routes:
When deploying to a remote server, the
/submit/{}route doesn't work anymore:http://swaplink.xyz/submit/sdfs
Root still works:
http://swaplink.xyz
I was told to add this code: https://github.com/yewstack/yew/blob/0.18.0/examples/router/src/switch.rs#L21-L88
Which I did in this branch: https://github.com/ivanschuetz/swaplink/pull/1
With the only effect that now locally the routing for
/submit/{}also doesn't work (differently to the remote server here it shows "Route doesn't match" on the UI (or similar, don't remember the exact wording).I tried to debug the issue by copy pasting my code into the yew example, and it works there. Maybe it's related with the fact that I'm using wasm-pack (I need it because of an npm dependency)?
Environment:
I doubt that it's relevant, but just in case this is my nginx config:
where
/srv/sites/swaplinkcontains the files generated in thedistfolder (as per readme).With another server, e.g:
it shows 404:
http://swaplink.xyz:3000/submit/sdsf
Root works:
http://swaplink.xyz:3000
Questionnaire
* I don't really have time but if it's a must to fix it quickly I can look into it, with some guidance.