MovedPermanently / -> /index.html

This commit is contained in:
norohind 2021-11-25 17:15:29 +03:00
parent 636443e097
commit b9d65cac7f
Signed by: norohind
GPG Key ID: 01C3BECC26FB59E1

6
web.py
View File

@ -66,8 +66,8 @@ class ActivityDiffHtml:
class MainPage:
def on_get(self, req: falcon.request.Request, resp: falcon.response.Response, var: str) -> None:
raise falcon.HTTPFound(f'/leaderboard/{var}')
def on_get(self, req: falcon.request.Request, resp: falcon.response.Response) -> None:
raise falcon.HTTPMovedPermanently('/index.html')
class Cache:
@ -89,6 +89,8 @@ app.add_route('/diff/{action_id}', ActivityDiffHtml())
app.add_route('/api/cache/{action}', Cache())
app.add_route('/', MainPage())
application = app # for uwsgi
index_file = os.path.join(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'static'), 'index.html')