Add LINK_LENGTH variable (#254)
This commit is contained in:
parent
94094505fb
commit
7be595c3cc
|
@ -4,6 +4,9 @@ PORT=3000
|
|||
# The domain that this website is on
|
||||
DEFAULT_DOMAIN="localhost:3000"
|
||||
|
||||
# Generated link length
|
||||
LINK_LENGTH=6
|
||||
|
||||
# Postgres database credential details
|
||||
DB_HOST=localhost
|
||||
DB_PORT=5432
|
||||
|
|
|
@ -4,6 +4,9 @@ PORT={{PORT}}
|
|||
# The domain that this website is on
|
||||
DEFAULT_DOMAIN={{DEFAULT_DOMAIN}}
|
||||
|
||||
# Generated link length
|
||||
LINK_LENGTH={{LINK_LENGTH}}
|
||||
|
||||
# Neo4j database credential details
|
||||
DB_URI={{DB_URI}}
|
||||
DB_USERNAME={{DB_USERNAME}}
|
||||
|
@ -57,4 +60,4 @@ MAIL_PASSWORD={{MAIL_PASSWORD}}
|
|||
REPORT_MAIL={{REPORT_MAIL}}
|
||||
|
||||
# Support email to show on the app
|
||||
CONTACT_EMAIL={{CONTACT_EMAIL}}
|
||||
CONTACT_EMAIL={{CONTACT_EMAIL}}
|
||||
|
|
|
@ -36,7 +36,7 @@ const dnsLookup = promisify(dns.lookup);
|
|||
const generateId = async () => {
|
||||
const address = generate(
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
6
|
||||
Number(process.env.LINK_LENGTH) || 6
|
||||
);
|
||||
const link = await findLink({ address });
|
||||
if (!link) return address;
|
||||
|
|
Loading…
Reference in New Issue