diff --git a/static_index/.gitattributes b/static_index/.gitattributes new file mode 100644 index 00000000..dfe07704 --- /dev/null +++ b/static_index/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/static_index/Cargo.toml b/static_index/Cargo.toml new file mode 100644 index 00000000..ea69161e --- /dev/null +++ b/static_index/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "static_index" +version = "0.1.0" +authors = ["Jose Marinez "] + +[dependencies] +futures = "0.1" +env_logger = "0.5" +actix = "^0.5.5" +actix-web = { git="https://github.com/actix/actix-web.git" } + +[workspace] +members = [ + "./" +] \ No newline at end of file diff --git a/static_index/README.md b/static_index/README.md new file mode 100644 index 00000000..7b03edbd --- /dev/null +++ b/static_index/README.md @@ -0,0 +1 @@ +# static_index diff --git a/static_index/src/main.rs b/static_index/src/main.rs new file mode 100644 index 00000000..f7434702 --- /dev/null +++ b/static_index/src/main.rs @@ -0,0 +1,32 @@ +extern crate actix; +extern crate actix_web; +extern crate env_logger; + +use actix_web::{fs, App, server, middleware}; + +fn main() { + ::std::env::set_var("RUST_LOG", "actix_web=info"); + ::std::env::set_var("RUST_BACKTRACE", "1"); + env_logger::init(); + + let sys = actix::System::new("static_index"); + + + server::new( + || App::new() + // enable logger + .middleware(middleware::Logger::default()) + .handler( + "/", + fs::StaticFiles::new("./static/").index_file("index.html") + ) + ) + + .bind("127.0.0.1:8080").expect( "Can not start server on given IP/Port" ) + .start(); + + println!("Started http server: 127.0.0.1:8080"); + let _ = sys.run(); + +} + diff --git a/static_index/static/actixLogo.png b/static_index/static/actixLogo.png new file mode 100644 index 00000000..142e4e8d Binary files /dev/null and b/static_index/static/actixLogo.png differ diff --git a/static_index/static/favicon.ico b/static_index/static/favicon.ico new file mode 100644 index 00000000..03018db5 Binary files /dev/null and b/static_index/static/favicon.ico differ diff --git a/static_index/static/index.html b/static_index/static/index.html new file mode 100644 index 00000000..e59e13f1 --- /dev/null +++ b/static_index/static/index.html @@ -0,0 +1,90 @@ + + + + + + + + +

Chat!

+
+  | Status: + disconnected +
+
+
+
+ + +
+ +