function doGet(e) {
var response = {
"code": 200,
"message": "hell world google app script"
};
return ContentService.createTextOutput(JSON.stringify(response)).setMimeType(ContentService.MimeType.JSON);
}
//this will not work and CORS error will appear in your browser console
//from backend, it works perfectly
function doPost(e) {
var response = {
"code": 200,
"message": "hell world google app script"
};
return ContentService.createTextOutput(JSON.stringify(response)).setMimeType(ContentService.MimeType.JSON);
}
After the deployment as web app plus anonymous mode
You will have a ready to use http public url
This url is ready to use in the backend or frontend with these restrictions