Skip to content

Commit

Permalink
Allow non-server apps to run
Browse files Browse the repository at this point in the history
Clarification should be made on why it was disabled in the first place if it meant to be disabled.
  • Loading branch information
dariusc93 committed Dec 7, 2018
1 parent 864c5af commit 2433659
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,21 @@ impl ApplicationBuilder {

let mut app_state = AppState { lua: None, init_path: init_path, settings: general };

app_state.lua = Some(app_state.create_addr());

if let Some(web) = config.web_server {

let single_actor = match web.get("single_actor").map(|s| { s.as_str() }) {
Some(Some("true")) => true,
Some(Some("false")) => false,
None => false,
Some(Some("false")) | None => false,
_ => {
println!("Error: Setting web_server.single_actor must be either \"true\" or \"false\"");
std::process::exit(1);
},
};

if single_actor {
app_state.lua = Some(app_state.create_addr());
if !single_actor {
app_state.lua = None;
}

log::debug!("web server section in settings, starting seting up web server");
Expand Down Expand Up @@ -255,9 +256,6 @@ impl ApplicationBuilder {
server.start();

let _ = sys.run();
} else {
println!("Non web-server apps not yet supported.");
std::process::exit(1);
}

}
Expand Down

0 comments on commit 2433659

Please sign in to comment.