/examples/web/baseservers.py
Python | 22 lines | 8 code | 6 blank | 8 comment | 0 complexity | 9cf5cd4d3b8f620a9ac877a5687f6fcb MD5 | raw file
1#!/usr/bin/env python 2 3from circuits import Component 4from circuits.web import BaseServer 5 6 7class Root(Component): 8 9 def request(self, request, response): 10 """Request Handler 11 12 Using ``BaseServer`` provides no URL dispatching of any kind. 13 Requests are handled by any event handler listening to 14 ``Request`` events and must accept a (request, response) 15 as arguments. 16 """ 17 18 return "Hello World!" 19 20app = BaseServer(("0.0.0.0", 8000)) 21Root().register(app) 22app.run()