Splitting up some code
In preparation for splitting schala into crates
This commit is contained in:
parent
98e1a5235a
commit
910522537c
@ -41,6 +41,10 @@ fn main() {
|
||||
Box::new(maaru_lang::Maaru::new()),
|
||||
Box::new(robo_lang::Robo::new()),
|
||||
];
|
||||
schala_main(languages);
|
||||
}
|
||||
|
||||
fn schala_main(languages: Vec<Box<ProgrammingLanguageInterface>>) {
|
||||
|
||||
let option_matches = program_options().parse(std::env::args()).unwrap_or_else(|e| {
|
||||
println!("{:?}", e);
|
||||
@ -60,7 +64,7 @@ fn main() {
|
||||
}
|
||||
|
||||
if option_matches.opt_present("webapp") {
|
||||
webapp::web_main();
|
||||
webapp::web_main(languages);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,6 @@ fn interpreter_input(input: Json<Input>) -> Json<Output> {
|
||||
Json(Output { text: code_output.to_string() })
|
||||
}
|
||||
|
||||
pub fn web_main() {
|
||||
pub fn web_main(languages: Vec<Box<ProgrammingLanguageInterface>>) {
|
||||
rocket::ignite().mount("/", routes![index, js_bundle, interpreter_input]).launch();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user