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

Add "/server-info/" frontend endpoint in development builds #1190

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

waxlamp
Copy link
Member

@waxlamp waxlamp commented Jul 13, 2022

This PR adds an "endpoint" to the frontend that proxies to the backend server info endpoint, emulating the mechanism in place on the Netlify-controlled deploys.

This works but only if you ask for the path complete with trailing slash, and I'm not sure why. Reviewers, perhaps you can recommend a better way to make this work so that the trailing slash is not required.

Closes #1108.

@waxlamp waxlamp changed the title Add "/sever-info" frontend endpoint in development builds Add "/server-info" frontend endpoint in development builds Jul 13, 2022
@danlamanna
Copy link
Contributor

I think a better solution would be to proxy /api, making it a standard that a $gui_url/api is the location for retrieving information.

@waxlamp
Copy link
Member Author

waxlamp commented Jul 18, 2022

I think a better solution would be to proxy /api, making it a standard that a $gui_url/api is the location for retrieving information.

I agree, and I'll file an issue to make this the standard way the API is proxied through to the front end, but if we can merge this PR, it will provide the CLI team immediate value, and then we can get to the fuller solution afterwards.

@yarikoptic
Copy link
Member

confirming that it works as intended:

$> curl http://localhost:8085/server-info/
{"schema_version":"0.6.3","schema_url":"https://raw.githubusercontent.com/dandi/schema/master/releases/0.6.3/dandiset.json","version":"0.2.39.post19+g9b92512f","services":{"api":{"url":"http://localhost:8000/api"},"webui":{"url":"http://localhost:8085"},"jupyterhub":{"url":"https://hub.dandiarchive.org/"}},"cli-minimal-version":"0.14.2","cli-bad-versions":[]}

(whenever on master it gives html page about JS needed etc).

@waxlamp waxlamp merged commit 9a643ce into master Jul 27, 2022
@waxlamp waxlamp deleted the internal-server-info branch July 27, 2022 21:05
@yarikoptic yarikoptic changed the title Add "/server-info" frontend endpoint in development builds Add "/server-info/" frontend endpoint in development builds Jul 29, 2022
@dandibot
Copy link
Member

dandibot commented Aug 3, 2022

🚀 PR was released in v0.2.42 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Q: provide /server-info "natively" (or redirected to) by web service?
5 participants