I received this error while run the back end server of Cube js. using npm run dev to started the server. while accessing a given link. It shows error like below. Help me to resolve
Cannot GET /cubejs-api/v1
I received this error while run the back end server of Cube js. using npm run dev to started the server. while accessing a given link. It shows error like below. Help me to resolve
Cannot GET /cubejs-api/v1
There's no such API path /cubejs-api/v1
. I believe you're looking for /cubejs-api/v1/load
: https://cube.dev/docs/rest-api#api-reference-v-1-load.
This misconception comes because of the following code generated by CubeJS:
const cubejsApi = cubejs(
"<API Auth>",
{ apiUrl: API_URL + "/cubejs-api/v1" }
);
What you in fact want to do on Postman or what have you is use the following url to run queries add load after v1.
Example
{{HOST}}/cubejs-api/v1/load?query={
"measures": [
"UserOrderValue.minDate",
"UserOrderValue.maxDate",
"UserOrderValue.lastWeek",
"UserOrderValue.lastMonth",
"UserOrderValue.lastQuarter",
"UserOrderValue.lastYear"
]
}