Search code examples
javagoogle-app-enginenetwork-programmingdnsgoogle-cloud-dns

How can i connect different Google App Engine Version urls to A different domain name?


When you upload a new version to app engine, let's call it '0001', you can send requests to this version directly using this url: http://0001.myapp.appspot.com

I find it very useful and I made an habit to release my web apps pointing to the corresponding server version. So when I upload version 0002 to the app engine it points to http://0002.myapp.appspot.com, the same goes to version 0003: http://0003.myapp.appspot.com.

My Challenge is that; when i want to link them to custom domains like;

Instead it links the entire AppId "myapp" to "www.money.com". How do i point them to different domians?


Solution

  • What you're looking for is called "services" on App Engine (formerly known as modules). Each service can have own version, but you should use it only for development/testing purposes.

    Basically your app config have <module> option:

    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
      <application>my-app</application>
      <module>mymodule</module>
      <version>0002</version>
    </appengine-web-app>
    

    You can have different modules deployed on same time, but mapped to different urls/domains by using dispatch.xml file:

    <dispatch-entries>
      <dispatch>
          <url>app.money.com/</url>
          <module>mymodule</module>
      </dispatch>
    </dispatch-entries>
    

    See also: