title: Google App Engine: Using Remote API with a Local GAE Dev Server
body: <p>I have a non-GAE backend that's using the Remote API to access datastore. The only way to do this (without a proxy GAE service) is to use the GAE Remote API. </p>
  
  <p>This works fine when connecting the Remote Context to a GAE production deployment, but what about GAE dev server? </p>
  
  <p>I want to be able to test my changes locally before deploying anything. Is there a way to connect the remote API to a local GAE dev server datastore?</p>
  
  <p>Relevant sample code:</p>
  
  <pre><code>func getRemoteCtx(ctx context.Context, r *http.Request) (context.Context, error) {
      ts, err := google.DefaultTokenSource(ctx,
          "https://www.googleapis.com/auth/appengine.apis",
          "https://www.googleapis.com/auth/userinfo.email",
          "https://www.googleapis.com/auth/cloud-platform",
      )
      if err != nil {
          log.Fatal(err)
      }
      hc := oauth2.NewClient(ctx, ts)
  
      host := "myapp.appspot.com"
  
      log.Printf("create remote context with host: %s", host)
      return remote_api.NewRemoteContext(host, hc)
  }
  </code></pre>
  
  <p>Check out the <code>host</code>. Is there a way to set this to a local GAE dev server?</p>