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

107
3
Jump to solution
02-26-2020 02:49 PM
Highlighted
Regular Contributor

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)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
MVP Honored 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

Reply
0 Kudos
3 Replies
Highlighted
MVP Esteemed Contributor

   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.

Reply
0 Kudos
Highlighted
MVP Honored 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

Reply
0 Kudos
Highlighted
Regular Contributor

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.

Reply
0 Kudos