mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
static files fix
This commit is contained in:
parent
94671f2220
commit
f0e6eb7901
@ -34,8 +34,8 @@ STATIC_PATH_LIB = pkg_resources.resource_filename("gradio", "static/")
|
|||||||
|
|
||||||
app = Flask(__name__,
|
app = Flask(__name__,
|
||||||
template_folder=STATIC_TEMPLATE_LIB,
|
template_folder=STATIC_TEMPLATE_LIB,
|
||||||
static_url_path="/static/",
|
static_folder=None) # TODO (aliabid94): replace with default static
|
||||||
static_folder=STATIC_PATH_LIB)
|
# handler
|
||||||
app.app_globals = {}
|
app.app_globals = {}
|
||||||
|
|
||||||
# Hide Flask default message
|
# Hide Flask default message
|
||||||
@ -85,6 +85,11 @@ def main():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/static/<path:path>")
|
||||||
|
def static(path):
|
||||||
|
return send_file(os.path.join(STATIC_PATH_LIB, path))
|
||||||
|
|
||||||
|
|
||||||
@app.route("/config/", methods=["GET"])
|
@app.route("/config/", methods=["GET"])
|
||||||
def config():
|
def config():
|
||||||
return jsonify(app.app_globals["config"])
|
return jsonify(app.app_globals["config"])
|
||||||
|
Loading…
Reference in New Issue
Block a user