/examples/web/controllers.py
Python | 23 lines | 10 code | 6 blank | 7 comment | 0 complexity | c123724e607d860b48314aa8840b3c66 MD5 | raw file
1#!/usr/bin/env python 2 3from circuits.web import Server, Controller, Static 4 5 6class Root(Controller): 7 8 def index(self): 9 """Index Request Handler 10 11 Controller(s) expose implicitly methods as request handlers. 12 Request Handlers can still be customized by using the ``@expose`` 13 decorator. For example exposing as a different path. 14 """ 15 16 return "Hello World!" 17 18app = Server(("0.0.0.0", 9000)) 19from circuits import Debugger 20Debugger().register(app) 21Static().register(app) 22Root().register(app) 23app.run()