simple http based meshd implemntation
This commit is contained in:
parent
97b8d53b0a
commit
33fb2570e0
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/target
|
1867
Cargo.lock
generated
Normal file
1867
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
10
Cargo.toml
Normal file
10
Cargo.toml
Normal 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
1
assets/main.mesh
Normal file
|
@ -0,0 +1 @@
|
|||
# Hi
|
17
src/main.rs
Normal file
17
src/main.rs
Normal 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
|
||||
}
|
Loading…
Reference in a new issue