How to get debug
or release
profile name?
#1898
-
I'd like to have different behavior* in one of my routes depending on whether we are in development or production. I thought the most reasonable way would be to use a State extractor for the rocket config, ala: .attach(AdHoc::config::<Config>()) and let uri = match config.profile.as_str().as_str() { // profile -> figment::UncasedStr -> str
"debug" => outf_name,
_ => String::from("s3://bucket/object"),
}; However, the returned string is simply How can we access the /ROCKET/ profile, which is automatically set as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is a bug, and it has been fixed on the master branch. Note that you don't need to attach the config as managed state, but you can actually just use |
Beta Was this translation helpful? Give feedback.
This is a bug, and it has been fixed on the master branch. Note that you don't need to attach the config as managed state, but you can actually just use
&Config
as a request guard to get the loaded config.