apiUrl in env.js of WAB (DE) apps?

580
3
Jump to solution
02-26-2020 02:49 PM
Arne_Gelfert
Occasional Contributor III

As I'm building various app's in Web AppBuilder (DE) and deploying them on our web server (Web Adaptor machine), I notice that some of them require a tweak in env.js where no apiUrl is set. In my case, adding the line below has always worked.

apiUrl = 'http://js.arcgis.com/3.31/',

But I'm not sure how env.js file is generated or updated by WAB throughout development. My suspicion is that as you add custom developed widget (either home grown or sources elsewhere), the need for this arises whereas something straight out of WAB doesn't need this?  Can anyone shine some light on this for me?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

This line exists but is commented out while the app is accessed through the WEB DE page. When you download the app, one of the things that the process does is uncomment that line. How are you deploying your apps? Are you using the download button or just copying the files from the server directory?

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

   Arne,

   The apiUrl gets set by WAB Dev in the NodeJS code. this is not something that you would normally have to manipulate unless you are wanting to use a api version that is different from the one that your current WAB Dev was designed for.

0 Kudos
KenBuja
MVP Esteemed Contributor

This line exists but is commented out while the app is accessed through the WEB DE page. When you download the app, one of the things that the process does is uncomment that line. How are you deploying your apps? Are you using the download button or just copying the files from the server directory?

0 Kudos
Arne_Gelfert
Occasional Contributor III

Ken, that must be it. Because I've done both - the export/zip from within WAB and then just straight folder zip and copy/paste. Didn't realize there was this going on behind the scenes. Great information. I'm trying to formulate some development best practices for our team as it pertains to WAB, and this needs to go in there.

0 Kudos