gourami

[UNMAINTAINED] Activitypub server in Rust
Log | Files | Refs | README | LICENSE

commit 1f252219813d1cce3630d3f89bf1ef83ddaa684a
parent 2f0fb2210af12138a3ca5b5f75f0f73bfce56c66
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Thu, 23 Apr 2020 20:07:34 -0500

Production deployment

Diffstat:
Msrc/lib.rs | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/lib.rs b/src/lib.rs @@ -466,7 +466,13 @@ pub async fn run_server() { .with(warp::log("server")) .recover(error_page); - warp::serve(routes) - .run(([127, 0, 0, 1], 3030)) - .await; + match std::env::var("GOURAMI_ENV").unwrap().as_str() { + "PROD" => warp::serve(routes) + .tls() + .cert_path(&std::env::var("CERT_PATH").unwrap()) + .key_path(&std::env::var("KEY_PATH").unwrap()) + .run(([0, 0, 0, 0], 443)) + .await , + _ => warp::serve(routes).run(([127,0,0,1], 3030)).await } +}