Skip to content
Snippets Groups Projects
Commit 83cbf842 authored by Jonas Leder's avatar Jonas Leder
Browse files

added link to sourcecode / my website

parent 0c26495a
No related branches found
Tags 1.7.8
No related merge requests found
......@@ -21,7 +21,7 @@ except:
builddate = ""
try:
if(os.environ["show_build_date"] == "1"): #If you want to see the builddate you can enable this enviorement variable
builddate = ", Build date: " + open("builddate.txt", "r").read()
builddate = open("builddate.txt", "r").read()
except:
pass #This exception is only to pass it while testing
......@@ -121,10 +121,10 @@ def redirect_short_url(short_url):
url = short[0]
error_404 = False
else:
error_404 = True #If no url is found throw a 404, the problem is, if I throw at this point a 404 it will be catched by the try, catch block.
error_404 = True #If no url is found throw a 404. If you throw a error in a try / catch block it will be catched by this, so set a variable to true and throw the error later
except Exception as e: #If there happens an error, print the exception to the console and throw a 500 error
print(e)
abort(500)
print(e) #Print a debug Message to the console
abort(500) #Throw a 500 error. This means internal Server error.
if not error_404: #If there was no 404 error before, redirect the user. If not throw a 404 error
return redirect(url)
else:
......
......@@ -16,13 +16,17 @@
<br><p> </p>
<input id="short" name="short" type="text" placeholder="short name" value="{{short_url_prefilled}}"/>
<button>short</button>
<p class="message">&copy; Made by jonasled {{builddate}}</p>
</form>
{% else %}
<h3>Your shortened URL is: <a href="http://{{short_url}}"> {{short_url}}</a></h3>
<img src="data:image/jpeg;base64,{{qrcode}}">
<p class="message">&copy; Made by jonasled {{builddate}}</p>
{% endif %}
<p class="message">&copy; Made by <a href="https://jonasled.de">jonasled</a><br>
Sourcecode is available <a href="https://git.jonasled.de/jonasled/url_shorter_docker">here</a><br>
{% if builddate %}
Builddate: {{builddate}}
{% endif %}
</p>
</div>
</div>
<div id="snackbar">{{snackbar}}</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment