At March 15, 2021, one endpoint is created for one deployment. Ref By this, when you redeploy "Web Apps", the endpoint is changed. Because the deployment ID is changed. It seems that this it the new specification. In this report, I would like to introduce the method for redeploying Web Apps without changing the URL of Web Apps for new IDE.
-
Open "New deployment" dialog with "Deploy" -> "New deployment".
-
Select "Web app" for "Select type".
-
Input "Description" and as a sample, set "Web apps" as follows.
Execute as: Me
Who has access: Anyone
-
Click "Deploy" button. And, copy the URL of "Web app" and click "Done" button. By this, you can see the following endpoint.
https://script.google.com/macros/s/###/exec
- When the script of Web Apps is changed and redeploy Web Apps, after March 15, 2021, the endpoint is changed. This is new specification. Because the deployment ID of
###
inhttps://script.google.com/macros/s/###/exec
is changed.
By this, there is an issue that the endpoint is changed. When you want to use the same endpoint by reflected the latest script to Web Apps, please do the following flow.
-
Create new Google Apps Script project and copy and paste the following script.
function doGet() { return ContentService.createTextOutput("sample1"); }
-
Deploy Web Apps as the following settings.
Execute as: Me
Who has access: Anyone
-
Test the Web Apps using the following curl command.
$ curl -L "https://script.google.com/macros/s/###/exec"
- Please confirm that
sample1
is returned.
- Please confirm that
-
Modify the script of Web Apps as follows.
function doGet() { return ContentService.createTextOutput("sample2"); // Modified }
-
Update the deployment as follows.
- Open "New deployment" dialog with "Deploy" -> "Manage deployments".
- For the 1st deployment, click the pencil icon for editing the deployment.
- Set "version" as "New version".
- When you want to change the description, please modify it.
- Click "Deploy" button.
-
Testing.
- Please use above sample curl command. By this, you can confirm that
sample2
is returned without changing the endpoint.
- Please use above sample curl command. By this, you can confirm that
Thank you very much for your input. I am trying to insert an image into a google sheet from https://github.com/doughazell/ionic-camera-swipe and this is only available in Google Apps Script (when everything else is done with Google Sheets API). I needed to do as you state after altering the static dev code in the 'doGet()' (since 'doPost()' isn't working at the moment).