gevent runner

This commit is contained in:
Kenneth Reitz
2011-09-29 01:27:31 -04:00
parent 286c7065d6
commit 4040ac794f
3 changed files with 18 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
web: gunicorn httpbin:app -b "0.0.0.0:$PORT" -w 3
web: python run_httpbin.py $PORT
+1 -1
View File
@@ -7,4 +7,4 @@ distribute==0.6.15
wsgiref==0.1.2
decorator==3.3.1
omnijson==0.1.2
gunicorn
gevent
Executable
+16
View File
@@ -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()