mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 14:50:17 +00:00
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
httpbin.runner
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
This module serves as a command-line runner for httpbin, powered by
|
||||
gunicorn.
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
from gevent.pywsgi import WSGIServer
|
||||
from httpbin import app
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
port = int(sys.argv[1])
|
||||
except (KeyError, ValueError, IndexError):
|
||||
port = 5000
|
||||
|
||||
print 'Starting httpbin on port {0}'.format(port)
|
||||
http_server = WSGIServer(('', port), app)
|
||||
http_server.serve_forever()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user