File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ pub struct HttpServerConfig {
77 pub external_port : u16 ,
88 pub host : String ,
99 pub external_host : String ,
10+ pub https_configured : bool ,
1011}
1112
1213impl LoadConfig for HttpServerConfig {
@@ -19,6 +20,7 @@ impl LoadConfig for HttpServerConfig {
1920 port,
2021 external_port : env_with_default ( "EXTERNAL_HTTP_SERVER_PORT" , port) ,
2122 external_host : env_with_default ( "EXTERNAL_HTTP_SERVER_HOST" , host) ,
23+ https_configured : env_with_default ( "HTTPS_CONFIGURED" , false ) ,
2224 }
2325 }
2426}
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ async fn main() {
3333 let external_addr = runner. get_server_config ( ) . external_port ;
3434 let external_host = runner. get_server_config ( ) . external_host . clone ( ) ;
3535
36+ let protocol = match runner. get_server_config ( ) . https_configured {
37+ true => String :: from ( "https" ) ,
38+ false => String :: from ( "http" ) ,
39+ } ;
40+
3641 let configs = vec ! [ ModuleDefinitionAppendix {
3742 module_identifier: String :: from( "draco-rest" ) ,
3843 definitions: vec![ ModuleDefinition {
@@ -42,6 +47,7 @@ async fn main() {
4247 host: external_host,
4348 port: external_addr as i64 ,
4449 endpoint: String :: from( r"/${{project_slug}}${{httpURL}}" ) ,
50+ protocol: protocol,
4551 } ,
4652 ) ) ,
4753 } ] ,
You can’t perform that action at this time.
0 commit comments