Created
May 14, 2021 08:07
-
-
Save Minobi/cb238645517a87387d55fd0c9c55e1d5 to your computer and use it in GitHub Desktop.
Template file for running Flask in production on Repl.it with Gevent and Flask-Compress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from gevent import monkey | |
monkey.patch_all() | |
from gevent.pywsgi import WSGIServer | |
from flask_compress import Compress | |
from flask import Flask, render_template | |
app = Flask(__name__) | |
compress = Compress() | |
compress.init_app(app) | |
@app.route('/') | |
def hello_world(): | |
return render_template('index.html') | |
if __name__ == '__main__': | |
http_server = WSGIServer(('0.0.0.0', 8080), app) | |
http_server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment