We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c110be commit d237925Copy full SHA for d237925
server/src/config.rs
@@ -25,9 +25,16 @@ impl Config {
25
/// `.env` file is supported.
26
pub fn from_env() -> Config {
27
dotenv().ok();
28
+
29
+ // Prefer the $PORT variable set by App Engine
30
+ let port = dotenv::var("PORT")
31
+ .ok()
32
+ .and_then(|p| p.parse().ok())
33
+ .unwrap_or_else(|| get_env("PORT", 8080u16)); // fallback
34
35
Config {
36
client_url: get_env("CLIENT_URL", "https://beta.solpg.io"),
- port: get_env("PORT", 8080u16),
37
+ port,
38
payload_limit: get_env("PAYLOAD_LIMIT", 1024usize * 1024 * 1024),
39
verbose: get_env("VERBOSE", false),
40
db_uri: get_env(
0 commit comments