snipette-rss-temp/app.py

26 lines
605 B
Python
Raw Normal View History

from flask import Flask, Response
2019-08-16 09:20:05 -04:00
app = Flask(__name__)
@app.route('/feed.xml')
def feed():
lines = []
with open('feed.xml', 'r') as f:
for l in f.readlines():
lines.append(l)
return Response('\n'.join(lines),
mimetype='application/rss+xml')
2019-08-16 09:20:05 -04:00
@app.route('/')
def homepage():
return '''
<h1>Whoops!</h1>
<p>
Hey! We're currently having some problems with our website,
since our server is down. We'll be back soon though. Thanks
for your patience!
</p>
'''
2019-08-16 09:20:05 -04:00
if __name__ == '__main__':
app.run(debug=True, use_reloader=True)