From 7e2187285dd58591cd07aa948cf3001cffe3ff29 Mon Sep 17 00:00:00 2001 From: Dennis Eriksen Date: Mon, 3 Jul 2023 13:40:30 +0200 Subject: adding lincence, and some other useful stuff --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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(); -- cgit v1.2.3