simple http based meshd implemntation

master
Able 2021-11-25 19:36:23 -06:00
parent 97b8d53b0a
commit 0a079be113
No known key found for this signature in database
GPG Key ID: 2BB8F62388A6A225
5 changed files with 1896 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

1867
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

10
Cargo.toml Normal file
View File

@ -0,0 +1,10 @@
[package]
name = "meshd"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-files = "0.5.0"
actix-web = "3.3.2"

1
assets/main.mesh Normal file
View File

@ -0,0 +1 @@
# Hi

17
src/main.rs Normal file
View File

@ -0,0 +1,17 @@
use actix_files as fs;
use actix_web::{App, HttpServer};
pub const ADDR_STR: &str = "0.0.0.0:1500";
#[actix_web::main]
async fn main() -> std::io::Result<()> {
println!("http://{}", ADDR_STR);
HttpServer::new(|| {
App::new().service(
fs::Files::new("/", "assets/")
.show_files_listing()
.use_last_modified(true),
)
})
.bind("0.0.0.0:1500")?
.run()
.await
}