digidhamu
digidhamu

Reputation: 727

Run Google AppEngine HelloWorld application

Could you please help me on Google AppEngine as I could not see any response from http://localhost:8080 though I can see below running... Also note that I could not shutdown using Ctrl+C as well. I am currently running this on Mac OSX 10.10.5.

hello.go

package hello

import (
    "fmt"
    "net/http"
)

func init() {
    http.HandleFunc("/", handler)
}

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprint(w, "Hello, world!")
}

app.yaml

application: helloworld
version: 1
runtime: go
api_version: go1

handlers:
- url: /.*
  script: _go_app

Terminal Output

INFO     2015-09-10 15:25:33,421 devappserver2.py:763] Skipping SDK update check.
WARNING  2015-09-10 15:25:33,480 simple_search_stub.py:1126] Could not read search indexes from /var/folders/dw/j8wnb7bn3bb0x_lh0v_gb1nw0000gn/T/appengine.helloworld.someuser/search_indexes
INFO     2015-09-10 15:25:33,483 api_server.py:205] Starting API server at: http://localhost:50462
INFO     2015-09-10 15:25:33,487 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2015-09-10 15:25:33,489 admin_server.py:118] Starting admin server at: http://localhost:8000

Upvotes: 1

Views: 146

Answers (1)

Alex Martelli
Alex Martelli

Reputation: 882691

I've tried reproducing your problem, but, I cannot -- the code runs fine.

Running on another terminal a curl to check the URL, I see on that other terminal

$ curl http://localhost:8080
Hello, world!$ 

exactly as I should, and, on the terminal window in which I'm running goapp, the following log lines appear:

INFO     2015-09-12 18:00:35,470 module.py:737] default: "GET / HTTP/1.1" 200 13
INFO     2015-09-12 18:00:52,841 module.py:737] default: "GET / HTTP/1.1" 200 13
INFO     2015-09-12 18:00:53,324 module.py:737] default: "GET /favicon.ico HTTP/1.1" 200 13

again, exactly as they should. Further, when I switch to the terminal running goapp, and hit control-C, I see, again as expected:

^Cgoapp: caught SIGINT, waiting for dev_appserver.py to shut down
INFO     2015-09-12 18:01:46,762 shutdown.py:45] Shutting down.
INFO     2015-09-12 18:01:46,763 api_server.py:588] Applying all pending transactions and saving the datastore
INFO     2015-09-12 18:01:46,763 api_server.py:591] Saving search indexes
$ 

I'm also on OSX 10.10.5 (14F27). What do YOU observe with that curl command on a different terminal window, both on the latter and on the terminal where you're running goapp? And what do you observe when you switch focus back to the terminal where you're running goapp, and hit control C?

Upvotes: 2

Related Questions