summaryrefslogtreecommitdiffstats
path: root/rust/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 11:04:23 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 11:04:23 -0700
commit9a303b182a32d2908caaaf5d24c7bc1ff3831505 (patch)
tree6867fc39395794127f30ecd375ec96a077160d32 /rust/src/bin
parent0319c8f531139c2b4c49570a499894d7200760f5 (diff)
downloadfatcat-9a303b182a32d2908caaaf5d24c7bc1ff3831505.tar.gz
fatcat-9a303b182a32d2908caaaf5d24c7bc1ff3831505.zip
broken diesel+iron integration
Diffstat (limited to 'rust/src/bin')
-rw-r--r--rust/src/bin/fatcat-iron.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/rust/src/bin/fatcat-iron.rs b/rust/src/bin/fatcat-iron.rs
index 0bed0fa2..1f443e8e 100644
--- a/rust/src/bin/fatcat-iron.rs
+++ b/rust/src/bin/fatcat-iron.rs
@@ -37,6 +37,11 @@ fn main() {
let logger = Logger::root(drain, o!());
let formatter = DefaultLogFormatter;
+ dotenv().ok();
+ let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
+
+ let diesel_middleware: DieselMiddleware<diesel::pg::PgConnection> = DieselMiddleware::new(database_url).unwrap();
+
let server = fatcat::server().unwrap();
let router = fatcat_api::router(server);
@@ -49,6 +54,7 @@ fn main() {
chain.link_before(AllowAllMiddleware::new("cosmo"));
chain.link_after(fatcat::XClacksOverheadMiddleware);
+ chain.link_before(diesel_middleware);
if matches.is_present("https") {
unimplemented!()