simple http based meshd implemntation

This commit is contained in:
Able 2021-11-25 19:36:23 -06:00
parent 97b8d53b0a
commit 33fb2570e0
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
}