blob: 1ed97abf46d5d662c1ed1f47b194a2f8bec49f32 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()
|