If I assign an url custom data source like below. Is it possible when calling field/members/select
but without attach endpoint to url
e.g., http://localhost:3400/api/cube for field but not http://localhost:3400/api/cube/field
e.g., http://localhost:3400/api/cube for select but not http://localhost:3400/api/cube/select
var pivot = new Flexmonster({
container: "pivotContainer",
report: {
dataSource: {
type: "api",
url: "http://localhost:3400/api/cube",
index: "data-set-123"
}
}
});
Hello,
Thank you for writing to us.
Yes, it is possible to have a single endpoint for all custom data source API requests.
This can be configured by specifying isSingleEndpointApi: true
in the /handshake response.
For example, here is a code snippet using Node.js:
cube.post("/handshake", async (req, res) => {
try {
res.json({ version: API_VERSION, isSingleEndpointApi: true });
} catch (err) {
handleError(err, res);
}
});
As a result, Flexmonster will send all requests (/fields
, /members
, /select
) to one endpoint that is specified in dataSource.url
(in your case, to http://localhost:3400/api/cube
).
Please let us know if this works.
Looking forward to your response.
Kind regards,
Vera
It's not what I expected. Because I don't want handshake with the end point"http://localhost:3400/api/cube/handshake" too.
It will be better for me if we can specify this from js directly.
EX:
new Flexmonster({
container: "pivot-container",
isSingleEndpointApi: true,
report: {
dataSource: {
type: "api",
url: "http://localhost:3400/api/cube",
index: "ABC"
}
}
});
Hello,
Thank you for your reply.
Regarding the idea to specify that a single endpoint is used as a configuration option (from JS directly):
Thank you for sharing your thoughts with us. Our team agrees that supporting such an approach would be a convenient feature to have.
Our team will look into this in more detail, and we will provide you with the results with the ETA 25th of January.
Please let us know if this would work for you.
Kind regards,
Vera
It will be great if you can add this feature, I would try this new feature after it finished.
Kind regards
Brad
Hello, Brad,
Thank you for your response.
We are happy to inform you that our team managed to provide the solution earlier than the given ETA.
Now a new singleEndpoint
property is available in the Data Source Object. If set to true
, all custom data source API requests will be sent to a single endpoint specified in dataSource.url
.
Here is an example of singleEndpoint
usage:
dataSource:{
type:"api",
url:"http://localhost:3400/api/cube", <- All API requests will be sent to this endpoint
index:"fm-product-sales",
singleEndpoint: true
}
This is available in the latest minor release of Flexmonster: https://www.flexmonster.com/release-notes/.
You are welcome to update the component. Here is our updating to the latest version tutorial for guidance.
Please let us know if this works fine for you.
We would be grateful for your feedback.
Kind regards,
Vera
Hello, Brad,
Our team is wondering if you've found the latest feature helpful.
Does the dataSource.singleEndpoint
property work fine for you?
Please let us know if everything works.
Looking forward to your feedback.
Kind regards,
Vera
The new feature works fine for us. Thanks for your rapidly response.