Kill webapp for now
I might add this back in later but for now I'd have to catch up to so much rocket that it's easier to just leave it out
This commit is contained in:
parent
f8f3095f89
commit
694c152fcd
@ -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"
|
||||
|
@ -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,
|
||||
|
@ -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<String> {
|
||||
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<String> {
|
||||
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 = "<input>")]
|
||||
fn interpreter_input(input: Json<Input>, generators: State<Vec<PLIGenerator>>) -> Json<Output> {
|
||||
let mut schala: Box<ProgrammingLanguageInterface> = 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<PLIGenerator>*/) {
|
||||
rocket::ignite()/*.manage(language_generators)*/.mount("/", routes![index, js_bundle, /*interpreter_input*/]).launch();
|
||||
}
|
Loading…
Reference in New Issue
Block a user