-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add landing page at base URL #172
Conversation
Codecov Report
@@ Coverage Diff @@
## master #172 +/- ##
==========================================
- Coverage 86.37% 86.24% -0.14%
==========================================
Files 39 40 +1
Lines 1850 1868 +18
==========================================
+ Hits 1598 1611 +13
- Misses 252 257 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Should be added to the versioned base URLs as well, yeah.
But for those I would update the title to include "versioned" as well as have the available endpoints reflect the version we are currently under - and perhaps the base URL should show only the REQUIRED versioned base URL, i.e., vMAJOR?
To complete it, I think we should have the new OPTiMaDe logo on top when it's finally released as well including the text.
Can you add a setting to return just a JSON summary response instead of HTML? I'm not a big fan of mixing the API and the Frontend. Another option might be to redirect to docs. |
I would agree, and this is what we were doing previously, but there was a long discussion and now this approach is recommended by the spec. See Materials-Consortia/OPTIMADE#240 |
Co-Authored-By: Casper Welzel Andersen <[email protected]>
8d62654
to
f9363c3
Compare
Updated image at top with the current iteration. Just grabbing a png logo from our GitHub org at the moment. |
f9363c3
to
85d6e15
Compare
Looking at your updated landing page, I can see we need to update the default base URL for the index meta-database - the Edit: I will make a commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @ml-evs !
I have only one real comment, which concerns the redirect middelware.
But since you need this PR merged, I will create an issue for it and accept and merge this PR.
if request.scope["path"].endswith("/"): | ||
if request.scope["path"].endswith("/") and any( | ||
request.scope["path"].endswith(f"{endpoint}/") | ||
for endpoint in list(ENTRY_COLLECTIONS.keys()) + ["info"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this will not catch single-entry endpoints now.
Bump to v0.5.0 Changes: - Possibility for Docker deployment for both the index meta-database server as well as the regular server (#140, @ltalirz, @CasperWA) - Test building and starting Docker images with GitHub Actions CI (#140, @CasperWA, @ml-evs, @ltalirz) - Remove `/index` from the index meta-database's base URL (#140, @ltalirz, @CasperWA) - `include` query parameter (#163, @CasperWA) - Rename `optimade/server/deps.py` to `optimade/server/query_params.py` (#163, @CasperWA) - Human-readable landing page for versioned base URLs, as well as for `/optimade` (#172, @ml-evs) - Move mapper aliases to config file and out of mapper classes (#175, @ml-evs) Bug fixes: - Properly build versioned base URLs (#178, @CasperWA)
Closes #169.
Ended up using Jinja as it is pretty lightweight and will be much easier for us to maintain and easier for other implementers to write their own landing pages.
Here's what it looks like at my end:
![image](https://user-images.githubusercontent.com/7916000/74048792-c83ec600-49ca-11ea-99e6-39d479de7953.png)
Do we need any more info? I haven't mentioned the index meta-db yet but I guess we could get a link to that. We could also render this page for bare versioned URLs too, which currently will 404.
Slightly loathed to add tests for this...