diff --git a/schala-repl/Cargo.toml b/schala-repl/Cargo.toml index 451dfac..1f70e63 100644 --- a/schala-repl/Cargo.toml +++ b/schala-repl/Cargo.toml @@ -15,8 +15,6 @@ colored = "1.7" serde = "1.0.91" serde_derive = "1.0.91" serde_json = "1.0.15" -rocket = "0.4.0" -rocket_contrib = "0.4.0" phf = "0.7.12" includedir = "0.2.0" linefeed = "0.5.0" diff --git a/schala-repl/src/lib.rs b/schala-repl/src/lib.rs index 6961be3..32d5ee6 100644 --- a/schala-repl/src/lib.rs +++ b/schala-repl/src/lib.rs @@ -9,9 +9,6 @@ extern crate colored; #[macro_use] extern crate serde_derive; extern crate serde_json; -#[macro_use] -extern crate rocket; -extern crate rocket_contrib; extern crate includedir; extern crate phf; @@ -22,7 +19,6 @@ use std::process::exit; mod repl; mod language; -mod webapp; pub use language::{ProgrammingLanguageInterface, ComputationRequest, ComputationResponse, diff --git a/schala-repl/src/webapp.rs b/schala-repl/src/webapp.rs deleted file mode 100644 index a25e547..0000000 --- a/schala-repl/src/webapp.rs +++ /dev/null @@ -1,45 +0,0 @@ -use rocket; -use rocket::State; -use rocket::response::Content; -use rocket::http::ContentType; -use rocket_contrib::json::Json; -use crate::language::ProgrammingLanguageInterface; -use crate::WEBFILES; - -#[get("/")] -fn index() -> Content { - let path = "static/index.html"; - let html_contents = String::from_utf8(WEBFILES.get(path).unwrap().into_owned()).unwrap(); - Content(ContentType::HTML, html_contents) -} - -#[get("/bundle.js")] -fn js_bundle() -> Content { - let path = "static/bundle.js"; - let js_contents = String::from_utf8(WEBFILES.get(path).unwrap().into_owned()).unwrap(); - Content(ContentType::JavaScript, js_contents) -} - -#[derive(Debug, Serialize, Deserialize)] -struct Input { - source: String, -} - -#[derive(Serialize, Deserialize)] -struct Output { - text: String, -} - -/* -#[post("/input", format = "application/json", data = "")] -fn interpreter_input(input: Json, generators: State>) -> Json { - let mut schala: Box = schala_gen(); - //let code_output = schala.execute_pipeline(&input.source, &EvalOptions::default()); - let code_output = format!("NOTDONE"); - Json(Output { text: code_output.to_repl() }) -} -*/ - -pub fn web_main(/*language_generators: Vec*/) { - rocket::ignite()/*.manage(language_generators)*/.mount("/", routes![index, js_bundle, /*interpreter_input*/]).launch(); -}