diff options
author | Dennis Eriksen <d@ennis.no> | 2023-07-03 13:40:30 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2023-07-03 13:40:30 +0200 |
commit | 7e2187285dd58591cd07aa948cf3001cffe3ff29 (patch) | |
tree | ecb750727da84a73b7dba77f9b7c132cfb31d829 /src | |
parent | Changing name to purl-rs (diff) | |
download | purl-rs-7e2187285dd58591cd07aa948cf3001cffe3ff29.tar.gz |
adding lincence, and some other useful stuff
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 6 |
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(); |