diff --git a/Procfile b/Procfile index 11bcc81..0ee4503 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn httpbin:app -b "0.0.0.0:$PORT" -w 3 \ No newline at end of file +web: python run_httpbin.py $PORT \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index c44bc00..e2ee093 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ distribute==0.6.15 wsgiref==0.1.2 decorator==3.3.1 omnijson==0.1.2 -gunicorn \ No newline at end of file +gevent \ No newline at end of file diff --git a/run_httpbin.py b/run_httpbin.py new file mode 100755 index 0000000..3d7641b --- /dev/null +++ b/run_httpbin.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +import sys + +from gevent.wsgi import WSGIServer +from httpbin import app + + +try: + port = int(sys.argv[1]) +except (KeyError, ValueError): + port = 5000 + +print 'Starting httpbin on port {0}'.format(port) +http_server = WSGIServer(('', port), app) +http_server.serve_forever() \ No newline at end of file