summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lambda-calcul/rust/Cargo.toml1
-rw-r--r--lambda-calcul/rust/README.md3
-rw-r--r--lambda-calcul/rust/src/web.rs21
3 files changed, 14 insertions, 11 deletions
diff --git a/lambda-calcul/rust/Cargo.toml b/lambda-calcul/rust/Cargo.toml
index c742302..230e422 100644
--- a/lambda-calcul/rust/Cargo.toml
+++ b/lambda-calcul/rust/Cargo.toml
@@ -9,6 +9,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.128"
chrono = { version= "0.4.38", features = ["serde"]}
actix-web = "4.9.0"
+actix-files = "0.6.8"
env_logger = "0.8"
log = "0.4"
futures = "0.3.30"
diff --git a/lambda-calcul/rust/README.md b/lambda-calcul/rust/README.md
index e3a9e60..89c81d2 100644
--- a/lambda-calcul/rust/README.md
+++ b/lambda-calcul/rust/README.md
@@ -63,7 +63,7 @@ There are `--port` and `--host` arguments should one want to change the default
* [x] make command line to register more explicit
* [x] `nc -l` is a simple echo server to show what's sent by the server
-* [ ] keep the readme exposed by the server
+* [x] keep the readme exposed by the server
* [ ] use JSON formatting for request/response
* [ ] debug user address on the leaderboard page
* [ ] shows status of client (not connected/connected/replying correctly or not)
@@ -72,6 +72,7 @@ There are `--port` and `--host` arguments should one want to change the default
* [ ] cheatsheet λ-calcul exposed on `/help`
* [ ] propose to send JSON or S-Exp
* [ ] persist user state to avoid losing connections
+* [ ] deploy automatically server on punkachien.net with radicle CI
* [ ] ask people to implement something
* [ ] prepare starter kit to overcome
diff --git a/lambda-calcul/rust/src/web.rs b/lambda-calcul/rust/src/web.rs
index e0f0c4b..2c2789b 100644
--- a/lambda-calcul/rust/src/web.rs
+++ b/lambda-calcul/rust/src/web.rs
@@ -161,16 +161,16 @@ impl Client {
let result = match response {
Ok(expr) => {
if let Ok(vals) = parse_total(expr) {
- let actual = eval_all(&vals)
- .iter()
- .map(|v| format!("{}", v))
- .collect::<Vec<_>>()
- .join("\n");
- if actual == *expected {
- TestResult::TestSucceeded
- } else {
- TestResult::TestFailed(actual)
- }
+ let actual = eval_all(&vals)
+ .iter()
+ .map(|v| format!("{}", v))
+ .collect::<Vec<_>>()
+ .join("\n");
+ if actual == *expected {
+ TestResult::TestSucceeded
+ } else {
+ TestResult::TestFailed(actual)
+ }
} else {
TestResult::TestFailed("Could not parse response".to_string())
}
@@ -342,6 +342,7 @@ async fn main() -> std::io::Result<()> {
.service(register)
.service(eval)
.service(leaderboard)
+ .service(actix_files::Files::new("/", "./static").show_files_listing() )
})
.bind((options.host, options.port))?
.run()