diff --git a/app/app.py b/app/app.py new file mode 100644 index 0000000..5fab025 --- /dev/null +++ b/app/app.py @@ -0,0 +1,13 @@ +from flask import Flask, render_template, make_response, send_from_directory +import os + +app = Flask(__name__) + +@app.route('/') +def index(): + return render_template('index.xht') + +@app.route('/fortune') +def fortune(): + fortune = os.run('/usr/bin/fortune') + return render_template('fortune.j2', fortune=fortune) \ No newline at end of file diff --git a/app/templates/fortune.j2 b/app/templates/fortune.j2 new file mode 100644 index 0000000..b0c82d2 --- /dev/null +++ b/app/templates/fortune.j2 @@ -0,0 +1,15 @@ + + + +
++ your fortune is: {{ fortune }} +
+ get a new fortune + \ No newline at end of file diff --git a/app/templates/index.xht b/app/templates/index.xht new file mode 100644 index 0000000..c7b47d0 --- /dev/null +++ b/app/templates/index.xht @@ -0,0 +1,17 @@ + + + + ++ fortune as a service is a simple web application that provides random fortunes, + from the /usr/bin/fortune command on Arch Linux, with our patent-pending AI Layer + 2 code execution engine. +
+ get a fortune + \ No newline at end of file