Learn to build and deploy simple Go Web Apps, Part Two

In part one of this tutorial, we installed the Google App Engine SDK and then built and ran a simple web app locally.

Now, we shall deploy our simple web app to the Google App Engine.

Uploading Your App to Google’s App Engine

Registering the App

You will now need to have a Google account. If you do not have a Google account, you can create a Google account with an email address and password.

You create and manage App Engine web applications from the App Engine Administration Console. Sign in to App Engine using your Google account.

To create a new application, click the “Create Application” button.

Verify your account

As seen in the image above, you will be asked to verify your account. Enter your mobile details and wait for the verification code.

After receiving it, enter your verification code as shown below:

Enter Verification code

A “Create an Application” screen comes up as shown below:

Create an application

Here you need to enter an unique “Application Identifier” (a name unique to this application). We have entered wcomemsg.

Also enter your “Application Title”.

Note: Once you register an Application Identifier, you can delete it, but you can’t re-register that same application ID after it has been deleted.

We have elected to use the free appspot.com domain name. With that the full URL for the application will be http://your_app_id.appspot.com/.

Accept the terms and click on the “Create Application” button. If successful, you should see a screen like this:

Application registered

Edit the app.yaml file, then change the value of the application: setting from welcome to your registered application ID.

Upload and Access the app

Before you upload your finished application to Google App Engine, it is advisable that you create an application-specific password.

Once that has been registered, you can upload your app. From the folder:
$GOPATH/src/github.com/SatishTalim folder, type:

goapp deploy welcome/

You will be asked to enter your Google email id and the password that you have just created.

If you see compilation errors, fix the source and re-run goapp deploy; it won’t launch (or update) your app until compilation is successful.

Access the app

You can now see your application running on App Engine. We have our message app running, that you can access and check out.

Congrats you have just successfully launched your first Go web app for the world to see!!

App Engine determines that an incoming request is intended for your application using the domain name of the request. A request whose domain name is http://your_app_id.appspot.com is routed to the application whose ID is your_app_id. Every application gets an appspot.com domain name for free.

Requests for these URLs all go to the version of your application that you have selected as the default version in the App Engine Administration Console. Each version of your application also has its own URL, so you can deploy and test a new version before making it the default version. The version-specific URL uses the version identifier from your app’s configuration file in addition to the appspot.com domain name, in this pattern: http://version_id-dot-latest-dot-your_app_id.appspot.com. We have for example, version 2 of our app here.

In part three, you will learn about package template (namely text/template and html/template).

I hope you’ve enjoyed this post, please leave any feedback in the comments section.

You can find the other parts of the series at the following links:

About these ads

About indianguru

http://satishtalim.com/
This entry was posted in Go, Tutorials and tagged , , . Bookmark the permalink.

4 Responses to Learn to build and deploy simple Go Web Apps, Part Two

  1. Pingback: Learn to build and deploy simple Go Web Apps, Part One | Josh Software – Where Programming is an Art!

  2. Pingback: My articles on Go for JoshSoftware

  3. Pingback: Learn to build and deploy simple Go Web Apps, Part Three | Josh Software – Where Programming is an Art!

  4. Pingback: Learn to build and deploy simple Go Web Apps, Part Four | Josh Software – Where Programming is an Art!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s