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

carta-frontend: Make the API endpoint configurable, or prepend the Base URL #2336

Open
at88mph opened this issue Jan 16, 2024 · 2 comments
Open

Comments

@at88mph
Copy link

at88mph commented Jan 16, 2024

Describe the bug
We run the carta-backend and carta-frontend:

add-apt-repository ppa:cartavis-team/carta && \
apt update && \
apt install -y carta

In the browser, we serve it at some generated session ID:
https://example.com/sessions/carta/28938

Which works for most things, other than accessing the API endpoints (layout, database).

The apiAddress is looked up in the /config document:
https://github.com/CARTAvis/carta-frontend/blob/dev/src/index.tsx#L36

This is hard-coded to be an absolute path, if enabled (/api):
https://github.com/CARTAvis/carta-backend/blob/dev/src/HttpServer/HttpServer.cc#L111

Which means the current baseURL is ignored and the base /api is expected to be routed. Just making that api rather than /api would ensure it is kept in the current context, or simply making it configurable if it isn't already.

To Reproduce
Steps to reproduce the behaviour:
While running in the browser:

  1. Go to 'View' -> 'Layouts' -> 'Save Layout'
  2. Enter name
  3. Click 'Save'
  4. We expect https://example.com/sessions/carta/28938/api/database/layout, but the PUT is trying to use https://example.com/api/database/layout

Expected behaviour
Keep the API calls in the current context, under the current baseURL as declared in:
https://github.com/CARTAvis/carta-frontend/blob/dev/src/index.tsx#L32

Platform info (please complete the following information):

  • MacOS Sonoma
  • Browser Safari 17.2.1
  • Browser Google Chrome 120.0.69
@at88mph
Copy link
Author

at88mph commented Feb 12, 2024

Hi there. I noticed this got placed into GitHub Projects. Does that mean it will be looked into? Thanks!

@kswang1029
Copy link
Collaborator

We are handling this issue via CARTAvis/carta-backend#1338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: New issues/PRs
Development

No branches or pull requests

2 participants