Commit 33628a56 authored by 132ikl's avatar 132ikl

Add API and clean code

parent b58f1dd2
......@@ -4,13 +4,14 @@ admin_username: 'admin'
# Plaintext password to make admin API requests
# Safe to remove if admin_hashed_password is set
# Default: commented out, 'password'
#admin_password: 'password'
# Default: unset
admin_password: 'password'
# Hashed password (bcrypt) to make admin API requests - Preferred over plaintext, use securepass.sh to generate
# Please note that authentication takes noticeably longer than using plaintext password
# Don't include the <username>: segment, just the hash
# Default: '$2y$15$Dhll3IY42R.JNOYazarlG.8IndwMjxmHLpFsebJzcGTJd.gbsAwna' (hash for 'password')
admin_hashed_password: '$2y$15$Dhll3IY42R.JNOYazarlG.8IndwMjxmHLpFsebJzcGTJd.gbsAwna'
#admin_hashed_password: '$2y$15$Dhll3IY42R.JNOYazarlG.8IndwMjxmHLpFsebJzcGTJd.gbsAwna'
# Filename of the URL database
# Default: 'urls'
......@@ -30,4 +31,9 @@ random_gen_timeout: 5
# Name shown on tab while on site and on page header
# Default: 'liteshort'
site_name: 'liteshort'
\ No newline at end of file
site_name: 'liteshort'
# URL shown when finished generating shortlinks. Include the / at the end.
# If not set, it is automatically taken from the URL the shorten request is sent to.
# Default: unset
site_url:
\ No newline at end of file
This diff is collapsed.
......@@ -3,10 +3,6 @@ div.form {
text-align: center;
}
input {
margin: auto;
}
div.success {
display: inline-block;
font-family: Open Sans;
......
......@@ -12,11 +12,15 @@
<div class="form">
<h2>{{ config.site_name }}</h2>
<form class="pure-form">
<input name="long" type="url" placeholder="Long URL">
<p>
<input name="short" type="text" placeholder="Custom link (optional)">
<input name="long" type="url" placeholder="Long URL">
</p>
<p>
<button type="submit" class="pure-button pure-button-primary" formmethod="post">Shorten</button>
<input name="short" type="text" placeholder="Custom link (optional)">
</p>
<p>
<button type="submit" class="pure-button pure-button-primary" formmethod="post">Shorten</button>
</p>
</form>
</div>
{% if result is defined and result[0] %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment