Let's start with the fact that there isn't much documentation on /dev
vs /exec
endpoints. If you have some valuable info I can't find, I would totally love to see it, no sarcasm.
From what I can find, dev is the current editing version, and exec is the last published version of your scripts (or an older version if you so choose).
This tells me I should be able to edit my standalone web app scripts without worrying about whether it breaks things for the users because if it isn't published, they don't see the change. Except this isn't actually the case.
Very easy to duplicate, just make a new web app, and put a console.log("Anything you want")
, in the doGet
function. Publish and run, and you will see your log in the console, awesome! Now go back, remove the console line, do not publish, and run it again. Your console output will no longer run, which it should have because you didn't publish.
So my question is, where is the documentation on how this actually should function because, with the limited info I've been able to find, it appears broken.
The exec
URL is the current published version of your Web App, whereas the dev
URL runs the most recently saved code and can only be accessed by users who have edit access.
From the documentation on Web Apps:
Once you click Deploy, you'll see a new dialog with a message indicating that your project has been successfully deployed as a web app.
This dialog provides two important URLs for your app:
The first is labeled Current web app URL and ends in
/exec
. This URL is for the published version of your app, based on the last version you saved and deployed.The second is the link labeled latest code and ends in
/dev
. This URL can only be accessed by users who have edit access to the script. This instance of the app always runs the most recently saved code — not necessarily a formal version — and is intended for quick testing during development.You can share the web app URL with those you would like to use your app, provided you have granted them access.
The ID of the web app URL for /exec
and /dev
endpoints are not the same.
You can see this by viewing the Web App deloyment modal - the URL provided in the Current web app URL
section is the /exec
URL and the link provided in the Test web app for your latest code.
string is the /dev
URL. Note the IDs before the final /
are not equivalent.