From 79b9af907148752a30a5cf90d989d8affb302d5e Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Tue, 21 Jun 2022 16:56:48 -0400 Subject: [PATCH] Say something on startup --- app/main.py | 5 ++++- app/static/js/app.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index e179661..bc0ea56 100644 --- a/app/main.py +++ b/app/main.py @@ -140,11 +140,14 @@ def main(): else: from waitress import serve + url_scheme = "https" if args.ssl else "http" + print("Running on %s://%s:%s" % (url_scheme, args.host, args.port)) + serve( app, host=args.host, port=args.port, - url_scheme="https" if args.ssl else "http", + url_scheme=url_scheme, ) diff --git a/app/static/js/app.js b/app/static/js/app.js index de29041..28ad7b8 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -168,7 +168,8 @@ document.addEventListener('DOMContentLoaded', function(){ ' q: ' + this.$options.filters.escape(this.inputText) + ',', ' source: ' + this.$options.filters.escape(this.sourceLang) + ',', ' target: ' + this.$options.filters.escape(this.targetLang) + ',', - ' format: "' + (this.isHtml ? "html" : "text") + '"', + ' format: "' + (this.isHtml ? "html" : "text") + '",', + ' api_key: "' + (localStorage.getItem("api_key") || "") + '"', ' }),', ' headers: { "Content-Type": "application/json" }', '});',