/examples/web/jsoncontroller.py
Python | 13 lines | 7 code | 5 blank | 1 comment | 0 complexity | 8261098323da2839ac95e5725fab1399 MD5 | raw file
1#!/usr/bin/env python 2 3from circuits.web import Server, JSONController 4 5 6class Root(JSONController): 7 8 def index(self): 9 return {"success": True, "message": "Hello World!"} 10 11app = Server(("0.0.0.0", 8000)) 12Root().register(app) 13app.run()