diff --git a/Cargo.toml b/Cargo.toml index 9144139..64f96f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,9 @@ base64 = "0.10.0" serde_json = "1.0.36" [dependencies.rocket_contrib] -version = "*" +version = "0.4.0" default-features = false -features = ["json"] +features = ["json", "serve"] [[bin]] name = "Server" diff --git a/main.rs b/main.rs index 7f88e41..dbec9c6 100644 --- a/main.rs +++ b/main.rs @@ -1,12 +1,18 @@ #![feature(proc_macro_hygiene, decl_macro)] #[macro_use] extern crate rocket; +#[macro_use] extern crate rocket_contrib; -#[get("/")] -fn index() -> &'static str { - "Hello, world!" -} +use rocket_contrib::serve::StaticFiles; fn main() { - rocket::ignite().mount("/", routes![index]).launch(); + let myrocket = rocket::ignite().mount("/", StaticFiles::from("static")); + let myrocket = myrocket.mount("/api", routes![world]); + myrocket.launch(); +} + + +#[get("/")] +fn world() -> &'static str { + "Hello, world!" } \ No newline at end of file diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..edece3a --- /dev/null +++ b/static/index.html @@ -0,0 +1,17 @@ + + + + + + Neo Poseidon + + + + + +

Welcome to Neo Poseidon

+

This is an open source game inspired by Neptune's Pride. An extremely slow paced real time strategy game

+ + + + \ No newline at end of file