cube
cube copied to clipboard
Allow to set basePath of the REST API to '/'
Describe the bug
Setting basePath
in cube.js to /
results in 404 across all API endpoints
To Reproduce Steps to reproduce the behavior:
- Create a cube.js fils
- Set
basePath: '/'
- Try accessing the API at [base host]/v1/meta
- Receive a 404
Expected behavior The API should be accessible at [base host]/v1/meta
Version: v0.35.1
Additional context
Setting the basePath
to a different value, e.g. /test
results in proper behavior ([base host]/test/v1/meta returns 200)
I was able to confirm this behavior.
@slatkovic Could you please describe your use case? Why would you like to have an empty base path?
BTW, as a workaround, you can (and probably should) put Cube behind a reverse proxy if you're self-hosting.
@igorlukanin, we have an API gateway set up to interface with Cube at (an example URL of) https://api.domain.com/cube.
Currently, our configuration uses /api
as the basePath
, placing the meta endpoint at https://api.domain.com/cube/api/v1/meta. Ideally, we'd like to reconfigure this so the endpoint is directly accessible under https://api.domain.com/cube/v1/meta instead.