Tutorial - Domain, Subdomain and Wildcard Subdomain

Goal of this tutorial application is to give you an idea how to use Domain, Subdomain and Wildcard Subdomain using aah framework. Reference to Routes Config.

How to get the aah tutorials source code?

go get -u -d github.com/go-aah/tutorials


Focus on following files:

  domain-subdomain/config/routes.conf
  domain-subdomain/app/controllers/wildcard/app.go
  domain-subdomain/app/controllers/admin/app.go

Let’s see it in the action

Configuring local DNS mapping

First we have to configure your hosts file. Purpose is do local DNS mapping for sample.com. This step is not applicable for production, typically these settings happens in your domain DNS manager. Learn more about Wildcard DNS - wikipedia

This rackspace article covers the steps to modify-your-hosts-file for Mac, Linux and Windows.

127.0.0.1       sample.com admin.sample.com username1.sample.com username2.sample.com username3.sample.com

Running the tutorial application

aah run -i github.com/go-aah/tutorials/domain-subdomain

Now visit these URL’s in your browser :)



Spread the word of aah, the web framework for Go. Thank you!

  Need Help?

  •   Chat on Gitter
  •   Github Issues
  •   Ask on StackOverflow - tag aahframework