Trying webapp

Note this doesn't work yet
This commit is contained in:
greg
2017-09-19 01:54:54 -07:00
parent e3b236a15d
commit 006fd7d411
4 changed files with 24 additions and 0 deletions

View File

@@ -24,6 +24,8 @@ mod robo_lang;
mod language;
use language::{ProgrammingLanguageInterface, EvalOptions, LLVMCodeString};
mod webapp;
mod llvm_wrap;
mod virtual_machine;
@@ -69,6 +71,11 @@ fn main() {
std::process::exit(0);
}
if option_matches.opt_present("w") {
webapp::web_main();
std::process::exit(0);
}
let language_names: Vec<String> = languages.iter().map(|lang| {lang.get_language_name()}).collect();
let initial_index: usize =
option_matches.opt_str("l")
@@ -361,6 +368,9 @@ fn program_options() -> getopts::Options {
options.optflag("a",
"assembler",
"Assemble file into bytecode");
options.optflag("w",
"webapp",
"Start up web interpreter");
options
}

8
src/webapp.rs Normal file
View File

@@ -0,0 +1,8 @@
#[get("/")]
fn index() -> &'static str {
"rocket test"
}
fn web_main() {
rocket::ignite().mount("/", routes![index]).launch();
}