title: Developing Golang backend locally for Nativescript mobile application
body: <p>I'm working on a Nativescript mobile application, and at the same time trying to design a Golang backend.  I have no experience actually deploying a backend though, so for now i'm just trying to develop locally.  So I have some button on my emulated application:</p>
  
  <pre><code>import { Http } from "@angular/http"                                                                
  
  +@Component({...}
  +export class LoginComponent implements OnInit {...}{
  
      . . .
  
      // &lt;Button ... (tap)="get_test()"&gt;&lt;/Button&gt; 
      public get_test(){                                                                              
          this.http.get("http://localhost:8080/");                                                    
      }                                                                                               
  
  }  
  </code></pre>
  
  <p>And a small web server I copied from the <a href="https://golang.org/doc/articles/wiki/" rel="nofollow noreferrer">golang website</a>:</p>
  
  <pre><code> package main
  
   import (
       "log"
       "net/http"
   )
  
   func handler(w http.ResponseWriter, r *http.Request) {
       print("recieved")
   }
  
   func main() {
       http.HandleFunc("/", handler)
       log.Fatal(http.ListenAndServe(":8080", nil))
   }
  </code></pre>
  
  <p>I start up the <code>go</code> "server":</p>
  
  <pre><code>go build main.go
  ./main
  </code></pre>
  
  <p>Now my thinking was that by clicking the button, the command line should print out <code>recieved</code> and I could use this going forward for designing my requests.  Yet nothing happens on either side.  There might be plenty of errors here in the code, and i'm not even sure you can emulate this locally.  But any help would be appreciated.</p>