Skip to content

How to use constant prefix for uri! #2419

Answered by elibroftw
elibroftw asked this question in Questions
Discussion options

You must be logged in to vote

I experimented and got this

use rocket::http::uri::Origin;
// OLD const TAURI_UPDATER_PREFIX: &str = "/tauri-releases";
const TAURI_UPDATER_PREFIX: Origin<'static> = uri!("/tauri-releases");

...
Redirect::to(uri!(TAURI_UPDATER_PREFIX, google_keep_desktop_api("win64", "1.18.0")))
...
.mount(TAURI_UPDATER_PREFIX, routes![google_keep_desktop_api])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by elibroftw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant