diff --git a/emojos.py b/emojos.py
index 6bcf367..e306ed0 100644
--- a/emojos.py
+++ b/emojos.py
@@ -13,6 +13,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see .
+import botocore.session
import operator
import requests
import urllib.parse
@@ -41,6 +42,17 @@ def no_content():
return ('', 204)
+@app.route('/code')
+def code():
+ context = request.environ.get('lambda.context')
+ session = botocore.session.get_session()
+ # region name is detected from lambda environment
+ client = session.create_client('lambda')
+ code = client.get_function(FunctionName=context.function_name,
+ Qualifier=context.function_version)
+ return redirect(code['Code']['Location'], code=303)
+
+
@app.route('/', methods=('GET', 'POST'))
def index():
if request.method == 'POST':
diff --git a/requirements.txt b/requirements.txt
index 308e3da..1efeb54 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,4 @@
Flask
+botocore
requests
zappa
diff --git a/static/site.css b/static/site.css
index 8a8889e..be07f2f 100644
--- a/static/site.css
+++ b/static/site.css
@@ -43,3 +43,7 @@ dl.emojo dd {
dl.emojo dd.success {
color: rgb(202, 143, 4);
}
+
+footer {
+ font-size: smaller;
+}
diff --git a/templates/base.html b/templates/base.html
index e1dbbc3..cb24de2 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -8,5 +8,18 @@
{% block body %}
{% endblock body %}
+
+ {% block script %}
+ {% endblock script %}