Created
September 17, 2012 23:14
-
-
Save boris317/3740353 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import os | |
| class WSGIApp(object): | |
| def __init__(self): | |
| setup_logger(os.environ.get('PYCSW_CONFIG')) | |
| def __call__(self, env, start_repsonse): | |
| """ Do reqeust stuff here """ | |
| application = WSGIApp() | |
| if __name__ == '__main__': # run inline using WSGI reference implementation | |
| from wsgiref.simple_server import make_server | |
| port = 8000 | |
| if len(sys.argv) > 1: | |
| port = int(sys.argv[1]) | |
| httpd = make_server('', port, application) | |
| print "Serving on port %d..." % port | |
| httpd.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment