mirror of
https://github.com/agersant/polaris
synced 2024-12-03 18:19:09 +00:00
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() {
|
fn main() {
|
||||||
|
|
||||||
println!("Spawning server thread");
|
println!("Starting up server");
|
||||||
std::thread::spawn(move || {
|
|
||||||
let mut api_chain;
|
let mut api_chain;
|
||||||
{
|
{
|
||||||
let api_handler;
|
let api_handler;
|
||||||
|
@ -59,8 +58,10 @@ fn main() {
|
||||||
let mut mount = Mount::new();
|
let mut mount = Mount::new();
|
||||||
mount.mount("/api/", api_chain);
|
mount.mount("/api/", api_chain);
|
||||||
mount.mount("/", Static::new(Path::new("web")));
|
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();
|
ui::run();
|
||||||
|
|
||||||
|
println!("Shutting down server");
|
||||||
|
server.close().unwrap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue