/examples/web/jsoncontroller.py
https://bitbucket.org/prologic/circuits/ · Python · 13 lines · 7 code · 5 blank · 1 comment · 0 complexity · 8261098323da2839ac95e5725fab1399 MD5 · raw file
- #!/usr/bin/env python
- from circuits.web import Server, JSONController
- class Root(JSONController):
- def index(self):
- return {"success": True, "message": "Hello World!"}
- app = Server(("0.0.0.0", 8000))
- Root().register(app)
- app.run()