aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs
index 8dd0f93..638a9a0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -24,11 +24,11 @@ use url::Url;
// Do the dirty
fn main() {
- // Get variables from dotenv
- let dburl:&str = &dotenv::var("DATABASE_URL").unwrap();
+ // Get variables from dotenv, or use defaults
+ let dburl:&str = &dotenv::var("DATABASE_URL").unwrap_or("postgresql://localhost/purl-rs".to_string());
let create_uri:&str = &dotenv::var("CREATE_URI").unwrap_or("/create".to_string());
let form_uri:&str = &dotenv::var("FORM_URI").unwrap_or("/form".to_string());
- let short_uri_prefix:&str = &dotenv::var("SHORT_URI_PREFIX").unwrap_or("/".to_string());
+ let short_uri_prefix:&str = &dotenv::var("SHORT_URI_PREFIX").unwrap_or("/+".to_string());
// Connect to db
let mut db = Client::connect(dburl, NoTls).unwrap();