Skip to content

Commit

Permalink
Revert "Remove flask app"
Browse files Browse the repository at this point in the history
This reverts commit e5beed9.
  • Loading branch information
crazyguitar committed Mar 5, 2016
1 parent 2a604c5 commit fc2ad7e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: make && gunicorn app:app --log-file -
27 changes: 27 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
This is a simple cheatsheet webapp.
"""
import os

from flask import Flask, send_from_directory
from flask_sslify import SSLify

DIR = os.path.dirname(os.path.realpath(__file__))
ROOT = os.path.join(DIR, 'docs', '_build', 'html')

app = Flask(__name__)
if 'DYNO' in os.environ:
sslify = SSLify(app)

@app.route('/<path:path>')
def static_proxy(path):
"""Static files proxy"""
return send_from_directory(ROOT, path)

@app.route('/')
def index_redirection():
"""Redirecting index file"""
return send_from_directory(ROOT, 'index.html')

if __name__ == "__main__":
app.run(debug=True)

0 comments on commit fc2ad7e

Please sign in to comment.