/examples/web/jsoncontroller.py

https://bitbucket.org/prologic/circuits/ · Python · 13 lines · 7 code · 5 blank · 1 comment · 0 complexity · 8261098323da2839ac95e5725fab1399 MD5 · raw file

  1. #!/usr/bin/env python
  2. from circuits.web import Server, JSONController
  3. class Root(JSONController):
  4. def index(self):
  5. return {"success": True, "message": "Hello World!"}
  6. app = Server(("0.0.0.0", 8000))
  7. Root().register(app)
  8. app.run()