websy85 / nodejs-qliksense

An example of using a NodeJS backend to integrate with Qlik Sense
18 stars 9 forks source link

JavaScript server path error #3

Open gabiQlik opened 8 years ago

gabiQlik commented 8 years ago

@websy85 I have a problem with the JS on the server. I've followed the configuration tutorial and I've managed to create the server and successfully authenticate on the hub/qmc. However, I'm not able to display the test object on the index page, as the JavaScript is not loaded.

I think the problem is that the server is trying to load the JS from http://link:port_number/JS files, instead of http://link/JS files. If I remove the port number from script.js, all the files are loaded, but it fails the authentication. I've tried to create the JS files in the Public folder, but they are not loaded.

Could you give me some pointers about this issue or how could I solve it?

websy85 commented 8 years ago

@gabiQlik Which version of Sense are you running? Am I correct in thinking you're running the solution against Qlik Sense Enterprise as well? If so then you'll need to connect to a virtual proxy that allows anonymous access. If you're authenticating then depending on how you authenticate you'll need to do some additional steps. If by chance you're running desktop then it may be that the path you're providing isn't correct.

Thanks Nick

gabiQlik commented 8 years ago

I'm running the latest version of QlikSense Server. I'm not using QS Enterprise. I've tinkered a little bit with the code and it seems that when it's trying to load the require.js from the server, the authentication part of the script is not running.

websy85 commented 8 years ago

@gabiQlik the example code only works for anonymous access. I'd recommend creating a new virtual proxy and configuring to be always anonymous. Authentication with the Capabilities API can be tricky so it's best to avoid it at first. You can find more example code and solutions on Qlik Playground which might help.

gabiQlik commented 8 years ago

Thank you for the reply.

It would be a good idea, easy to implement if I'd use anonymous authentication, but I need to log-in at least 2 users simultaneously. If I'd use anonymous authentication, I'd lose the selections and exhaust all the users tokens.

Even tough I'm not able to load the mashup, I'm able to access the Hub or QMC by using your code.

Thank you for the Qlik Playground link, it's a useful resource, but unfortunately there is no back-end code, but there are some nice front-end ideas.