mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-26 23:58:35 -06:00
fix: slug_style options are consistent now
This commit is contained in:
parent
599b013fc9
commit
6c7ca8d0ac
2 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@ pub fn add_link(req: String, db: &Connection) -> (bool, String) {
|
||||||
let chunks: Vec<&str> = req.split(';').collect();
|
let chunks: Vec<&str> = req.split(';').collect();
|
||||||
let longlink = String::from(chunks[0]);
|
let longlink = String::from(chunks[0]);
|
||||||
|
|
||||||
let style = env::var("slug_style").unwrap_or(String::from("pair"));
|
let style = env::var("slug_style").unwrap_or(String::from("Pair"));
|
||||||
let len_str = env::var("slug_length").unwrap_or(String::from("8"));
|
let len_str = env::var("slug_length").unwrap_or(String::from("8"));
|
||||||
let mut len: usize = len_str.parse().unwrap_or(8);
|
let mut len: usize = len_str.parse().unwrap_or(8);
|
||||||
if len < 4 {
|
if len < 4 {
|
||||||
|
|
|
@ -24,9 +24,9 @@ services:
|
||||||
|
|
||||||
# By default, the auto-generated pairs are adjective-name pairs
|
# By default, the auto-generated pairs are adjective-name pairs
|
||||||
# If you want UIDs, please change slug_style to UID
|
# If you want UIDs, please change slug_style to UID
|
||||||
# Supported values for slug_style are "pair" and "UID"
|
# Supported values for slug_style are "Pair" and "UID"
|
||||||
# The length is 8 by default, and a minimum of 4 is allowed
|
# The length is 8 by default, and a minimum of 4 is allowed
|
||||||
# - slug_style=pair
|
# - slug_style=Pair
|
||||||
# - slug_length=8
|
# - slug_length=8
|
||||||
volumes:
|
volumes:
|
||||||
- db:/urls.sqlite
|
- db:/urls.sqlite
|
||||||
|
|
Loading…
Reference in a new issue