Initial commit

This commit is contained in:
Jeff 2023-08-28 22:19:27 -04:00
parent aef92a4a31
commit 4d507e2f0f
4 changed files with 5188 additions and 0 deletions

2
shuttle/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
Secrets*.toml

5151
shuttle/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

11
shuttle/Cargo.toml Normal file
View File

@ -0,0 +1,11 @@
[package]
name = "jeffa"
version = "0.1.0"
edition = "2021"
[dependencies]
dust-lang = "0.1.1"
rocket = "0.5.0-rc.2"
shuttle-rocket = "0.25.0"
shuttle-runtime = "0.25.0"
tokio = "1.26.0"

24
shuttle/src/main.rs Normal file
View File

@ -0,0 +1,24 @@
use dust_lib;
#[macro_use]
extern crate rocket;
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
#[get("/dust/<code>")]
fn dust(code: &str) -> String {
match dust_lib::eval(code) {
Ok(result) => result.to_string(),
Err(error) => error.to_string(),
}
}
#[shuttle_runtime::main]
async fn rocket() -> shuttle_rocket::ShuttleRocket {
let rocket = rocket::build().mount("/", routes![index, dust]);
Ok(rocket.into())
}