Support Deployment to Heroku (#280)

* Added heroku.yml

* Added app.json

* PORT as env var
This commit is contained in:
dacousb 2021-09-19 21:03:01 +02:00 committed by GitHub
parent 567556711b
commit 350b796571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 48 additions and 2 deletions

View file

@ -133,10 +133,11 @@ async fn main() {
.get_matches();
let address = matches.value_of("address").unwrap_or("0.0.0.0");
let port = matches.value_of("port").unwrap_or("8080");
let port = std::env::var("PORT")
.unwrap_or_else(|_| matches.value_of("port").unwrap_or("8080").to_string());
let hsts = matches.value_of("hsts");
let listener = [address, ":", port].concat();
let listener = [address, ":", &port].concat();
println!("Starting Libreddit...");