Load values from Rocket.toml into managed state #74
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
help wanted
invalid
maintenance
peach-lib
peach-network
peach-oled
peach-stats
peach-web
question
refactor
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: PeachCloud/peach-workspace#74
Loading…
Reference in New Issue
No description provided.
Delete Branch "rocket_config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Based on discussion in issue #37, this PR moves the
standalone_mode
anddisable_auth
parameters intoRocket.toml
.Then, instead of reading the values from environment variables and using
lazy_static
to define global variables, we load them from the Rocket figment provider and add them to managed state.Managed state is rad because it can be accessed in routes and in request guards. We can easily extend the
RocketConfig
struct in the future to accommodate more config parameters. Since this seems to be "the Rocket way" of managing application state, I'm pretty happy about the change.I also changed
development
->debug
andproduction
->release
inRocket.toml
. These profile names must have changed in Rocket somewhere along the way (I had been wondering whydisable_auth
wasn't taking effect like it should be...now it works as expected).CC: @notplants