Skip to content

Instantly share code, notes, and snippets.

@c0debrain
Created September 11, 2017 04:17
Show Gist options
  • Save c0debrain/928d2e913cdd9332559388dd4def3c67 to your computer and use it in GitHub Desktop.
Save c0debrain/928d2e913cdd9332559388dd4def3c67 to your computer and use it in GitHub Desktop.
from flask import Flask, request, send_from_directory
# set the project root directory as the static folder, you can set others.
app = Flask(__name__, static_url_path='')
@app.route('/<path:path>')
def send_js(path):
return send_from_directory('', path)
@app.route('/')
def index():
return send_from_directory('','index.html')
@app.route("/hello")
def hello():
return "Hello World!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment