28 lines
No EOL
610 B
Python
28 lines
No EOL
610 B
Python
from flask import Flask, render_template, make_response
|
|
import os
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route('/')
|
|
def index():
|
|
return render_template('index.xht')
|
|
|
|
@app.route('/fortune')
|
|
def fortune():
|
|
fortune = os.popen("fortune").read()
|
|
return render_template('fortune.j2', fortune=fortune)
|
|
|
|
@app.route('/pricing')
|
|
def pricing():
|
|
return render_template('pricing.xht')
|
|
|
|
@app.route('/style.css')
|
|
def css():
|
|
css = render_template('index.css')
|
|
response = make_response(css)
|
|
response.mimetype = "text/css"
|
|
return response
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run(host="0.0.0.0", port=8080) |