Move web server onto main thread

This commit is contained in:
Lucien Greathouse
2017-12-18 01:20:04 -08:00
parent 6472a2cbce
commit f90c51e923
2 changed files with 69 additions and 75 deletions

View File

@@ -196,13 +196,9 @@ fn main() {
});
}
web::start(config.clone(), project.clone(), vfs.clone());
println!("Server listening on port {}", port);
loop {
thread::park();
}
web::start(config.clone(), project.clone(), vfs.clone());
},
("pack", _) => {
eprintln!("'rojo pack' is not yet implemented!");

View File

@@ -109,7 +109,6 @@ pub fn start(config: Config, project: Project, vfs: Arc<Mutex<Vfs>>) {
])));
}
thread::spawn(move || {
rouille::start_server(address, move |request| {
router!(request,
(GET) (/) => {
@@ -189,5 +188,4 @@ pub fn start(config: Config, project: Project, vfs: Arc<Mutex<Vfs>>) {
_ => rouille::Response::empty_404()
)
});
});
}