Web App Development with Google Apps Script/Hello world

Create a new script
You can create a new the same way you'd create a new Google Doc or Google Sheet: Using the "New" button scroll down to "" under "more". That will open a new script window with a simple test function in it:

If you write some code in that function you can run the function with the buttons at the top. Typically to see any results you'd have to use.

If you put javascript code outside of a function it will also execute whenever you run any of the functions. Keep that in mind as we develop web apps. Anything outside of a function will run every time the page is accessed or you run a server function with an ajax call.

Set up
To actually have a web app you have to do two things:


 * 1) Make sure you have a   function in your script, and
 * 2) Publish your site

Almost always you're going to want to write your html in a separate file (still housed in the overall script google entity) and then have the function call it and   it. Assuming you've created an html file called "main.html" you would call it like this:

You would then access the page by going under to the "Publish->Deploy As Web App..." menu item. Once it's published you can access the url from that same menu item.