From 8a3306b3e76acc1c2c433732b9e3b51f88596819 Mon Sep 17 00:00:00 2001 From: Evgenii Akentev Date: Sat, 18 May 2019 22:32:15 +0300 Subject: [PATCH] add static --- app.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index d1b3e2e..b288490 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,6 @@ from random import shuffle, random -from bottle import get, post, run, request +from bottle import get, post, run, request, static_file import uuid from geo import distance, move_coordinate from street_predictor import parse_summary @@ -197,5 +197,24 @@ def finish_game(game_id): "distance": d } +@get('/') +def index(): + return static_file('index.html', "front/build") + +@get('/static/css/') +def static_css(staticFile): + return static_file(staticFile, "front/build/static/css") + +@get('/static/js/') +def static_js(staticFile): + return static_file(staticFile, "front/build/static/js") + +@get('/static/media/') +def static_media(staticFile): + return static_file(staticFile, "front/build/static/media") + +@get('/') +def index(whatever): + return static_file('index.html', "front/build") run(host='localhost', port=8080, debug=True, server='paste') -- 2.50.1