chore: update examples

This commit is contained in:
Dmitriy Pleshevskiy 2020-02-08 22:11:37 +03:00
parent a9df98ae61
commit b7adb8afaf
5 changed files with 6 additions and 6 deletions

View file

@ -1 +1 @@
DATABASE_URL=postgres://user:test@localhost:5534:5432/db DATABASE_URL=postgres://user:test@localhost:5534/db

View file

@ -4,6 +4,6 @@ use diesel::pg::PgConnection;
pub fn establish_connection() -> PgConnection { pub fn establish_connection() -> PgConnection {
let database_url = cfg::DATABASE_URL(); let database_url = cfg::DATABASE_URL();
PgConnection::establish(&database_url) PgConnection::establish(database_url)
.expect(&format!("Error connecting to {}", database_url)) .expect(&format!("Error connecting to {}", database_url))
} }

View file

@ -13,7 +13,7 @@ use crate::models::*;
config! { config! {
DATABASE_URL: String, DATABASE_URL,
} }

View file

@ -18,7 +18,7 @@ config! {
PORT => 8000, PORT => 8000,
), ),
JSON_API_URL < ( static JSON_API_URL < (
HYPER_PREFER_SCHEMA, HYPER_PREFER_SCHEMA,
"://", "://",
HYPER_HOST, HYPER_HOST,

View file

@ -10,7 +10,7 @@ config! {
ROCKET { ROCKET {
HOST: String => "localhost", HOST: String => "localhost",
PORT: u16 => 9000, PORT: u16 => 9000,
BASE_URL: String => "/", BASE_URL => "/",
} }
} }
@ -24,6 +24,6 @@ fn main() {
cfg::init(); cfg::init();
rocket::ignite() rocket::ignite()
.mount(&cfg::ROCKET::BASE_URL(), routes![index]) .mount(cfg::ROCKET::BASE_URL(), routes![index])
.launch(); .launch();
} }