Shut down server when quitting
This commit is contained in:
parent
f82ddc484c
commit
e631138562
1 changed files with 22 additions and 21 deletions
|
@ -37,8 +37,7 @@ mod vfs;
|
|||
|
||||
fn main() {
|
||||
|
||||
println!("Spawning server thread");
|
||||
std::thread::spawn(move || {
|
||||
println!("Starting up server");
|
||||
let mut api_chain;
|
||||
{
|
||||
let api_handler;
|
||||
|
@ -59,8 +58,10 @@ fn main() {
|
|||
let mut mount = Mount::new();
|
||||
mount.mount("/api/", api_chain);
|
||||
mount.mount("/", Static::new(Path::new("web")));
|
||||
Iron::new(mount).http("localhost:3000").unwrap();
|
||||
});
|
||||
let mut server = Iron::new(mount).http("localhost:3000").unwrap();
|
||||
|
||||
ui::run();
|
||||
|
||||
println!("Shutting down server");
|
||||
server.close().unwrap();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue