1 Reply Latest reply: Nov 14, 2016 2:08 AM by Aiham Azmeh RSS

    Multiple baseUrls of RequireJS in a remote server mashup

    Eric Careta Cavagliani

      Hi everyone,
      I'm working on a project based on a qliksense mashup. This project is hosted in a different server than qliksense server.

       

       

      The problem is that the project uses requireJS to import everything and the baseURL of the requirejs config is a folder of this server.
      To use Qliksense API I need to use the baseURL of the qliksense server too..

       

      At this point..my questions are:

       

      It's possible to declare two baseURL o something like that? How?

      If this is not possible, are there any way to solve my problem?

      Thanks a lot!

        • Re: Multiple baseUrls of RequireJS in a remote server mashup
          Aiham Azmeh

          Hi Eric,

           

          I think you should be able to do:

          require( ["js/my_internal_module"], function ( myInternalModule ) {

                   //get all you "local" modules

               require.config( {

                    baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port: "") + config.prefix + "resources"

               } );

               require( ["js/qlik"], function ( qlik ) {

                    //use myInternalModule and qlik

               });

          });

              

          I hope this helps,