Home > Software engineering >  I want to use Google App Script with HTML Service to create a static HTML File, not a Web App. Can i
I want to use Google App Script with HTML Service to create a static HTML File, not a Web App. Can i

Time:11-25

I have created a Google App Script using HTML Service to publish a Web App. But the data doesn't change frequently and I am concerned about a large number of access requests to the Web App exceeding service quotas. I really don't need a Web App, I just want to create a static HTML file that I can embed on a web page. Does anyone know how to do this?

I would appreciate any suggestions.

CodePudding user response:

I tried this:

function savemystinkinghtml() {
  let tmpl = HtmlService.createTemplateFromFile('ah1');
  tmpl.msg = "I bid no Trump";
  let html = tmpl.evaluate();
  DriveApp.getFolderById(gobj.globals.testfolderid).createFile('indexgas.html',html.getContent());
}

html: 'ah1':

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
  </head>
  <body>
    <p><?= msg ?></p>
    </div>
  </body>
</html>

I download it to my laptop and uploaded to my website and it's works. Admittedly it trivial but it's html.

  • Related