flask server js return from folder

Solutions on MaxInterview for flask server js return from folder by the best coders in the world

showing results for - "flask server js return from folder"
Jana
23 Jan 2019
1from flask import Flask, request, send_from_directory
2
3# set the project root directory as the static folder, you can set others.
4app = Flask(__name__, static_url_path='')
5
6@app.route('/js/<path:path>')
7def send_js(path):
8    return send_from_directory('js', path)
9
10if __name__ == "__main__":
11    app.run()