From 1566790a8269c56e6a65e521fc696e00033ea4e1 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 9 Dec 2020 22:21:31 +0000 Subject: [PATCH] Serve protobuf files statically. --- Cargo.toml | 2 +- src/main.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b367eae..dc503f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,4 +26,4 @@ strum = { version = "0.20", features = ["derive"] } [dependencies.rocket_contrib] version = "0.4.6" default-features = false -features = [ "tera_templates", "diesel_sqlite_pool" ] \ No newline at end of file +features = [ "tera_templates", "diesel_sqlite_pool", "serve" ] \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index a9b5a03..7a5456b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ extern crate diesel; #[macro_use] extern crate serde_derive; +use rocket_contrib::serve::StaticFiles; use rocket_contrib::templates::Template; pub mod catchers; @@ -39,6 +40,10 @@ fn main() { .attach(db::TenebrousDbConn::fairing()) .mount("/", root_routes) .mount("/characters", character_routes) + .mount( + "/protos", + StaticFiles::from(concat!(env!("CARGO_MANIFEST_DIR"), "/proto")), + ) .register(catchers) .launch(); }