Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert website to simple static html #500

Merged
merged 1 commit into from
Oct 5, 2020

Conversation

lonvia
Copy link
Collaborator

@lonvia lonvia commented Oct 5, 2020

The website is simple enough that we don't really need flask or templating to serve it. Therefore remove Python completely from the project and convert the website to a simple index.html that can be served statically.

@christophlingg, please let me know if I have overseen something that requires the flask setup. This change removes a quiet large moving part for the website setup but also a couple of dependencies that regularly get us security warnings on the github repo.

The website is simple enough that we don't really need flask
or templating to serve it. Therefore remove Python completely
from the project and convert the website to a simple staticly
servable index.html.
Copy link
Member

@christophlingg christophlingg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes a lot of sense, when we started flask also served api request. but of course the leftovers now do not deserve a dynamic server.

@@ -0,0 +1,4 @@
API_URL = 'http://localhost:5001/api/?';
TILELAYER = 'https://{s}.tile.hosted.thunderforest.com/komoot-2/{z}/{x}/{y}.png';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess most people have high definition we could use https://{s}.tile.hosted.thunderforest.com/komoot-2/{z}/{x}/{y}@2x.png; instead. But maybe you also know about an option in leaflet to automatically change the URL depending on the display density? I found detectReting but that seems to produce pretty small maps.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look. I wanted to update leaflet anyways. That's a good opportunity to check that as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use {r} and leaflet will add @2x for those displays which support high resolution https://leafletjs.com/reference-1.7.1.html

@lonvia lonvia merged commit 6bec6bb into komoot:master Oct 5, 2020
@lonvia lonvia deleted the convert-website-to-static-files branch December 5, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants