From 73d9535a5d234ddc3972808847a2f629d6fba8f5 Mon Sep 17 00:00:00 2001 From: clerie Date: Fri, 13 Dec 2019 15:00:50 +0100 Subject: [PATCH] Added app --- README.md | 7 ++++++- app.py | 20 ++++++++++++++++++++ requirements.txt | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 app.py create mode 100644 requirements.txt diff --git a/README.md b/README.md index b7fe1a8..f9a54bc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ -# walduni +# Walduni Unoffical link shortner for TU Ilmenau + +You can access the link via https://walduni.de/ + +## Contribute +Clone the repo, add your link and do a pull-request. diff --git a/app.py b/app.py new file mode 100644 index 0000000..6499def --- /dev/null +++ b/app.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +from flask import Flask,redirect + +app = Flask(__name__) + +@app.route('/') +def tu_ilmenau(): + return redirect("https://www.tu-ilmenau.de/", code=302) + +@app.route('/about') +def about(): + return redirect("https://github.com/clerie/walduni", code=302) + +if __name__ == '__main__': + # Bind to PORT if defined, otherwise default to 5000. + port = int(os.environ.get('PORT', 5000)) + app.run(host='0.0.0.0', port=port) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..379219b --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Flask=1.1.1