Created
September 25, 2019 15:16
-
-
Save cabreraalex/ada3e7a06fbf9f6a218f15b9e214850c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, send_from_directory | |
import random | |
app = Flask(__name__) | |
# Path for our main Svelte page | |
@app.route("/") | |
def base(): | |
return send_from_directory('client/public', 'index.html') | |
# Path for all the static files (compiled JS/CSS, etc.) | |
@app.route("/<path:path>") | |
def home(path): | |
return send_from_directory('client/public', path) | |
@app.route("/rand") | |
def hello(): | |
return str(random.randint(0, 100)) | |
if __name__ == "__main__": | |
app.run(debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment