#Router not working when creating optional args

1 messages · Page 1 of 1 (latest)

crisp tide
#

I'm trying to get a router that can handle some languages like (fr, en, de, sp, kr) in the path, but it wont work for no reason known to me, my code compiles but it is always going to render the 404: Page not found text... Is there a way to do something like I want by using the way I'm doing it (but making it work lol)?

tall seal
#

is :lang* a thing?

#

i think * might be interpreted as /:lang<put anything of any length here>/release

#

given optional path segments appear to be not a thing, i assume a 2nd route with lang would work

#[at("/:lang/release")]
ReleaseLang { lang: Language },
#[at("/release")]
Release,
#[at("/:lang")]
AppLang { lang: Language },
#[at("/")]
App,
crisp tide
#

Yeah actually think it may be better like that when thinking about it, gonna go with that, thanks for the infos about route_recognizer 🙂