conf: cargo fmt
This commit is contained in:
parent
4bcaaa8f2f
commit
2c96fa702e
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
use std::env;
|
|
||||||
use jsonwebtoken::{DecodingKey, EncodingKey};
|
use jsonwebtoken::{DecodingKey, EncodingKey};
|
||||||
|
use std::env;
|
||||||
|
|
||||||
/// Central repository for the backend's config.
|
/// Central repository for the backend's config.
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
@ -13,7 +13,11 @@ pub struct Config {
|
||||||
|
|
||||||
impl Config {
|
impl Config {
|
||||||
pub fn from_env() -> Config {
|
pub fn from_env() -> Config {
|
||||||
let jwt_secret = parse_sha256(env::var("JWT_SECRET").expect("JWT_SECRET must be a 32-byte base-16 string").as_str());
|
let jwt_secret = parse_sha256(
|
||||||
|
env::var("JWT_SECRET")
|
||||||
|
.expect("JWT_SECRET must be a 32-byte base-16 string")
|
||||||
|
.as_str(),
|
||||||
|
);
|
||||||
Config {
|
Config {
|
||||||
bind_addr: env::var("BIND_ADDR").unwrap_or("localhost".into()),
|
bind_addr: env::var("BIND_ADDR").unwrap_or("localhost".into()),
|
||||||
bind_port: env::var("BIND_PORT")
|
bind_port: env::var("BIND_PORT")
|
||||||
|
|
Loading…
Reference in a new issue