Compare commits
No commits in common. "b3274f1a2a768e8b78c73e84d7cf6d6a624f3313" and "70818931aa50111fec6ca06418a2789422f38488" have entirely different histories.
b3274f1a2a
...
70818931aa
4 changed files with 0 additions and 74 deletions
21
server/.gitignore
vendored
21
server/.gitignore
vendored
|
@ -1,21 +0,0 @@
|
||||||
Cargo.lock
|
|
||||||
target/
|
|
||||||
guide/build/
|
|
||||||
/gh-pages
|
|
||||||
|
|
||||||
*.so
|
|
||||||
*.out
|
|
||||||
*.pyc
|
|
||||||
*.pid
|
|
||||||
*.sock
|
|
||||||
*~
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
|
||||||
**/*.rs.bk
|
|
||||||
|
|
||||||
# Configuration directory generated by CLion
|
|
||||||
.idea
|
|
||||||
|
|
||||||
# Configuration directory generated by VSCode
|
|
||||||
.vscode
|
|
|
@ -1,10 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "server"
|
|
||||||
version = "1.0.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
actix-web ="4"
|
|
||||||
utoipa = { version = "3", features = ["actix_extras"] }
|
|
|
@ -1,15 +0,0 @@
|
||||||
# installation
|
|
||||||
|
|
||||||
## windows (step 1)
|
|
||||||
|
|
||||||
choco install -y
|
|
||||||
|
|
||||||
## Linux, macos (alernate step 1)
|
|
||||||
|
|
||||||
use apt, pacman, curl, brew or whatever.
|
|
||||||
|
|
||||||
## Always (steps 2 and so on)
|
|
||||||
|
|
||||||
- `rustup-init.sh` (Windows: rustup-init.ex, e.g. %AppData%\Local\Temp\chocolatey\rustup.install\1.25.1\rustup-init.exe)
|
|
||||||
- select a good match in the dialog of this CLI installer
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};
|
|
||||||
|
|
||||||
#[get("/")]
|
|
||||||
async fn hello() -> impl Responder {
|
|
||||||
HttpResponse::Ok().body("Hello world!")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[post("/echo")]
|
|
||||||
async fn echo(req_body: String) -> impl Responder {
|
|
||||||
HttpResponse::Ok().body(req_body)
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn manual_hello() -> impl Responder {
|
|
||||||
HttpResponse::Ok().body("Hey there!")
|
|
||||||
}
|
|
||||||
|
|
||||||
#[actix_web::main]
|
|
||||||
async fn main() -> std::io::Result<()> {
|
|
||||||
HttpServer::new(|| {
|
|
||||||
App::new()
|
|
||||||
.service(hello)
|
|
||||||
.service(echo)
|
|
||||||
.route("/hey", web::get().to(manual_hello))
|
|
||||||
})
|
|
||||||
.bind(("127.0.0.1", 8080))?
|
|
||||||
.run()
|
|
||||||
.await
|
|
||||||
}
|
|
Loading…
Reference in a new issue