an python web framework like webpy and tornado
download the package or check out the project
then cd to the project folder
run these commands:
sudo python setup.py install
# coding=utf-8
from karloop.KarlBaseApplication import MultiThreadApplication
from karloop.KarlBaseHandler import BaseHandler
class HelloHandler(BaseHandler):
def get(self):
return self.response("hello world")
handlers = {
"/hello": HelloHandler
}
class HelloApplication(MultiThreadApplication):
def __init__(self):
super(HelloApplication, self).__init__(handlers=handlers)
if __name__ == "__main__":
application = HelloApplication()
application.listen(port=8888)
application.run()
python index.py
then open the web browser and go to "127.0.0.1:8888/hello", you will see the hello world.
This framework has been used on the linux version of CubeBackup for Google Apps, which is a local backup solution for Google Apps data.
If you find bugs or know how to fix them, please send a message to [email protected],special thanks.