Update Github CI configuration
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user