Make content a positional argument
[fwx] / main.py
1 import phial
2
3 def handler(request):
4     return phial.TextResponse(
5         content='Hello, world\n',
6     )
7
8 app = phial.App(handler)
9
10 if __name__ == '__main__':
11     from twisted.internet import reactor
12     from twisted.web.server import Site
13     from twisted.web.wsgi import WSGIResource
14
15     reactor_args = {}
16     resource = WSGIResource(reactor, reactor.getThreadPool(), app)
17     site = Site(resource)
18     reactor.listenTCP(5000, site)
19     reactor.run(**reactor_args)