Esempio n. 1
0
def root_static_get():
    file_name = flask.request.path.lstrip('/')
    if not file_name:
        file_name = 'index.html'
        cache = False
    else:
        cache = True
    static_file = StaticFile(app_server.www_path, file_name, cache=cache)
    return static_file.get_response()
Esempio n. 2
0
def static_get(file_path):
    try:
        static_file = StaticFile(app_server.www_path, file_path, cache=True)
    except InvalidStaticFile:
        return flask.abort(404)
    return static_file.get_response()
Esempio n. 3
0
def static_get(file_path):
    file_path = os.path.join(app_server.www_path, file_path)
    static_file = StaticFile(file_path, cache=True)
    return static_file.get_response()