/examples/web/baseservers.py
https://bitbucket.org/prologic/circuits/ · Python · 22 lines · 8 code · 6 blank · 8 comment · 0 complexity · 9cf5cd4d3b8f620a9ac877a5687f6fcb MD5 · raw file
- #!/usr/bin/env python
- from circuits import Component
- from circuits.web import BaseServer
- class Root(Component):
- def request(self, request, response):
- """Request Handler
- Using ``BaseServer`` provides no URL dispatching of any kind.
- Requests are handled by any event handler listening to
- ``Request`` events and must accept a (request, response)
- as arguments.
- """
- return "Hello World!"
- app = BaseServer(("0.0.0.0", 8000))
- Root().register(app)
- app.run()