summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2012-02-13 22:09:11 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2012-02-13 22:09:11 +0100
commit0d8e86265f74ee36503bbcec445dcefdea208df0 (patch)
treed129e83b5913124ca4542ae6b5e6c40fcafc6517 /app.py
Initial import.
Diffstat (limited to 'app.py')
-rwxr-xr-xapp.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/app.py b/app.py
new file mode 100755
index 0000000..1ed97ab
--- /dev/null
+++ b/app.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python2
+
+class Application(object):
+ def __call__(self, environ, start_response):
+ start_response('200 OK', [('Content-Type', 'text/html')])
+ return open('static/index.html', 'r')
+
+if __name__ == '__main__':
+ import sys
+ if len(sys.argv) == 3:
+ from flup.server.fcgi import WSGIServer
+ WSGIServer(Application(), bindAddress = (sys.argv[1], int(sys.argv[2]))).run()
+ else:
+ from wsgiref.simple_server import make_server, WSGIServer
+ # enable IPv6
+ WSGIServer.address_family |= 10
+ httpd = make_server('', 8000, Application())
+ httpd.serve_forever()