Update Github CI configuration

This commit is contained in:
2022-04-05 21:04:42 +02:00
parent 33401b3d39
commit 8e034d3914
7 changed files with 88 additions and 83 deletions

View File

@@ -29,7 +29,7 @@ impl Settings {
let config_file_required = file.is_some();
let config_path = env::var("CONFIG_PATH").unwrap_or_else(|_| "config".into());
let config_file = file.unwrap_or_else(|| {
env::var("CONFIG_FILE").unwrap_or_else(|_| format!("{}/dev", &config_path).into())
env::var("CONFIG_FILE").unwrap_or_else(|_| format!("{}/dev", &config_path))
});
let default_config_file = format!("{}/default", config_path);

View File

@@ -57,7 +57,7 @@ pub fn run(listener: TcpListener, settings: &Settings) -> Result<Server, std::io
"Mounting static files on {}",
if path.is_empty() { "/" } else { &path }
);
let static_scope = fs::Files::new(&path, &static_dir)
let static_scope = fs::Files::new(path, &static_dir)
.use_last_modified(true)
.index_file("index.html");
app = app.service(static_scope);

View File

@@ -17,7 +17,7 @@ fn setup_server(settings: &Settings) -> String {
let listener = TcpListener::bind("127.0.0.1:0").expect("Failed to bind random port");
let port = listener.local_addr().unwrap().port();
let server = contextswitch_api::run(listener, &settings).expect("Failed to bind address");
let server = contextswitch_api::run(listener, settings).expect("Failed to bind address");
let _ = tokio::spawn(server);
format!("http://127.0.0.1:{}", port)
}