1

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

2 Answers2

1

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.

Pavel Tiunov
  • 1,163
  • 6
  • 8
0

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"
  ]
}
Michael Nelles
  • 5,426
  • 8
  • 41
  • 57