Generate smart defaults for some values at some places
[fwx] / main.py
1 import phial
2
3 def handler(request):
4     return phial.Response(
5         content_type='text/plain',
6         content='Hello, world\n',
7     )
8
9 app = phial.App(handler)
10
11 if __name__ == '__main__':
12     from twisted.internet import reactor
13     from twisted.web.server import Site
14     from twisted.web.wsgi import WSGIResource
15
16     reactor_args = {}
17     resource = WSGIResource(reactor, reactor.getThreadPool(), app)
18     site = Site(resource)
19     reactor.listenTCP(5000, site)
20     reactor.run(**reactor_args)