Changes I make to my Code.gs
file don't seem to be recognized unless I deploy as webapp under a new version. Is this the designed behavior or am I doing something wrong elsewhere?
In case you're trying to update a deployment and want to keep the same URL, here's how to do it as of March 2021 :
You want this instead :
If you have a dozen other actives that you don't want, you can archive them (icon is right next to the pencil). If you archived the URL you were actually using in the past, you can bring it back by clicking on it under "Archived", then pencil icon, then Deploy.
How about this answer? Please think of this as just one of several answers.
At the project that Web Apps is deployed, when the script in the project was modified, the Web Apps is required to be redeployed as new version. By this, the latest script is reflected to the Web Apps. This is the normal specification. I think that this situation might be supposed to separate the developing script and stable script.
There are several methods that the latest script can be automatically reflected to Web Apps when the script was modified.
When the developer mode is used, the latest script can be used for the Web Apps without redeploying as new version. When you deploy the Web Apps, you can see "latest code" which has a link. The URL is like https://script.google.com/macros/s/###/dev
. By using this URL, when the script was modified, you can use the latest script at Web Apps.
As an important point, when you use this, please use the access token. By this, you can access to the Web Apps. The sample curl can be seen at here.
If you want to automatically use the latest script using the URL like https://script.google.com/macros/s/#####/exec
, it can be achieved using a library. The preparation is as follows.
function doGet(e) {return library.run(e)}
.
library
.function run(e) { do something }
.
By above settings, when the script of Project "B" is modified, the latest script is automatically reflected to the Web Apps. By this, it is not required to redeploy as new version.
If I misunderstood your question and this was not the direction you want, I apologize.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With