Esempio n. 1
0
def app_factory(environ, start_response):
    # rx, methods, app
    urls = [
        (re.compile(r'/layers$'), ('GET', 'HEAD',), get_layers),
        (re.compile(r'/auth$'), ('GET', 'HEAD',), authenticate_user),
        (re.compile(r'/data$'), ('POST'), read_data),
    ] 
    return router(urls)(environ, start_response)
Esempio n. 2
0
def app_factory():
    '''
    Define the regular expressions, methods, and handling functions
    for each URL you want the server to respond to.
    '''
    urls = [
        (re.compile(r'/'), ('GET', 'HEAD',), get_target),
        (re.compile(r'/'), ('POST'), post_target),
    ] 
    return router(urls)
Esempio n. 3
0
def app_factory(environ, start_response):
    # rx, methods, app
    urls = [
        (re.compile(r'/layers$'), (
            'GET',
            'HEAD',
        ), get_layers),
        (re.compile(r'/auth$'), (
            'GET',
            'HEAD',
        ), authenticate_user),
        (re.compile(r'/data$'), ('POST'), read_data),
    ]
    return router(urls)(environ, start_response)