class RestService(object):
    def __init__(self, jobmgr):
	self.app = Application()
        self.app.add_controller(RestController(jobmgr))
        self.app.configure()

    def start(self):
        self.app.serve(('0.0.0.0', 8080))
Beispiel #2
0
    def setUp(self):

        application = Application()
        application.add_controller(TestController())
        application.configure()
        self.server = application.serve(('localhost', 9090))
Beispiel #3
0
    def setUp(self):

        application = Application()
        application.add_controller(TestController())
        application.configure()
        self.server = application.serve(('localhost', 9090))
Beispiel #4
0
import sys
sys.path.append("/usr/lib/python2.7/site-packages")

from concurrence import dispatch
from concurrence.web import Application, Controller, web

class TestController(Controller):

    @web.route('/hello')
    def hello(self):
        return "Hello World!"
    
    @web.route('/pipe')
    def pipe(self):
        with open('/tmp/workfile', 'r') as f:
            f.read()
        f.close()
        return "OK"
    
if __name__ == '__main__':    
    application = Application()
    application.add_controller(TestController())
    application.configure()
    server = application.serve(('localhost', 8080))
    dispatch(server)    
Beispiel #5
0
def main():
    #create a web application
    application = Application()
    application.add_controller(ExampleController())
    application.configure()
    application.serve(('localhost', 8080))