summaryrefslogtreecommitdiffstats
path: root/rust/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 11:35:19 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 11:35:19 -0700
commit85d469196ff17a3aee7a950ae57d4797938e8f42 (patch)
tree5c3b6b36401d4673f46b4f905c3de6ff2438cbba /rust/src/bin
parent428898b3ca46855822c80c9bd8a9ae9c8da5aaf2 (diff)
downloadfatcat-85d469196ff17a3aee7a950ae57d4797938e8f42.tar.gz
fatcat-85d469196ff17a3aee7a950ae57d4797938e8f42.zip
fix build (non-functional though)
Diffstat (limited to 'rust/src/bin')
-rw-r--r--rust/src/bin/fatcat-iron.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/rust/src/bin/fatcat-iron.rs b/rust/src/bin/fatcat-iron.rs
index 1f443e8e..d89a9c53 100644
--- a/rust/src/bin/fatcat-iron.rs
+++ b/rust/src/bin/fatcat-iron.rs
@@ -5,6 +5,9 @@ extern crate clap;
extern crate fatcat;
extern crate fatcat_api;
extern crate futures;
+extern crate dotenv;
+extern crate diesel;
+extern crate iron_diesel_middleware;
extern crate iron;
extern crate iron_slog;
extern crate swagger;
@@ -18,6 +21,9 @@ use iron_slog::{LoggerMiddleware, DefaultLogFormatter};
use clap::{App, Arg};
use iron::{Chain, Iron};
use swagger::auth::AllowAllMiddleware;
+use dotenv::dotenv;
+use std::env;
+use iron_diesel_middleware::{DieselMiddleware, DieselPooledConnection, DieselReqExt};
/// Create custom server, wire it to the autogenerated router,
/// and pass it to the web server.
@@ -40,7 +46,7 @@ fn main() {
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 diesel_middleware: DieselMiddleware<diesel::pg::PgConnection> = DieselMiddleware::new(&database_url).unwrap();
let server = fatcat::server().unwrap();
let router = fatcat_api::router(server);
@@ -54,7 +60,7 @@ fn main() {
chain.link_before(AllowAllMiddleware::new("cosmo"));
chain.link_after(fatcat::XClacksOverheadMiddleware);
- chain.link_before(diesel_middleware);
+ //chain.link_before(diesel_middleware);
if matches.is_present("https") {
unimplemented!()