From c85a4b78515d84e46db06513f31de11ef35397d0 Mon Sep 17 00:00:00 2001 From: Dave Clement Date: Fri, 15 Nov 2019 19:19:05 -0800 Subject: [PATCH 1/6] fix numeric identifier in readme --- 015_understanding-TCP-servers/06_dial-write/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/015_understanding-TCP-servers/06_dial-write/README.md b/015_understanding-TCP-servers/06_dial-write/README.md index 3d836a76..5e9cdb6f 100644 --- a/015_understanding-TCP-servers/06_dial-write/README.md +++ b/015_understanding-TCP-servers/06_dial-write/README.md @@ -1,3 +1,3 @@ run "02_read-scanner" -run "07_dial-write" \ No newline at end of file +run "06_dial-write" \ No newline at end of file From 479d7e03cbc2d32dbaff7308280cc31d2a3d58c2 Mon Sep 17 00:00:00 2001 From: di-reu Date: Wed, 27 Nov 2019 11:57:05 +0100 Subject: [PATCH 2/6] update appengine deployment for v1.13 --- 026_appengine-deploy/01/app.yaml | 8 +++----- 026_appengine-deploy/02/app.yaml | 8 +++----- 026_appengine-deploy/README.md | 14 ++++++-------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/026_appengine-deploy/01/app.yaml b/026_appengine-deploy/01/app.yaml index 1dd8f1c6..fb82ec67 100644 --- a/026_appengine-deploy/01/app.yaml +++ b/026_appengine-deploy/01/app.yaml @@ -1,8 +1,6 @@ -application: temp-145415 -version: 1 -runtime: go -api_version: go1 +runtime: go113 handlers: - url: /.* - script: _go_app \ No newline at end of file + script: auto + secure: always \ No newline at end of file diff --git a/026_appengine-deploy/02/app.yaml b/026_appengine-deploy/02/app.yaml index 1dd8f1c6..fb82ec67 100644 --- a/026_appengine-deploy/02/app.yaml +++ b/026_appengine-deploy/02/app.yaml @@ -1,8 +1,6 @@ -application: temp-145415 -version: 1 -runtime: go -api_version: go1 +runtime: go113 handlers: - url: /.* - script: _go_app \ No newline at end of file + script: auto + secure: always \ No newline at end of file diff --git a/026_appengine-deploy/README.md b/026_appengine-deploy/README.md index 247ba1be..1ef5179c 100644 --- a/026_appengine-deploy/README.md +++ b/026_appengine-deploy/README.md @@ -1,4 +1,4 @@ -# buying a domain + # buying a domain https://domains.google/#/ @@ -13,18 +13,16 @@ https://domains.google/#/ - update the app.yaml file with your project ID ``` -application: temp-137512 -version: 1 -runtime: go -api_version: go1 +runtime: go113 handlers: - url: /.* - script: _go_app + script: auto + secure: always ``` -- deploy to that project +- deploy to that project. update --project with your project-id ``` -appcfg.py -A -V v1 update . +gcloud app deploy --project temp-137512 ``` - view your project - http://YOUR_PROJECT_ID.appspot.com/ From 388c20d1b93c37c7a8922cc15f3143ed0d3d2750 Mon Sep 17 00:00:00 2001 From: Mark Rosemaker <48681726+MarkRosemaker@users.noreply.github.com> Date: Thu, 12 Dec 2019 19:17:54 +0100 Subject: [PATCH 3/6] make localhost:8080/dog/ work --- 023_serving-files/02_serving/04_FileServer/01/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/023_serving-files/02_serving/04_FileServer/01/main.go b/023_serving-files/02_serving/04_FileServer/01/main.go index 5ff93afd..34a0df2a 100644 --- a/023_serving-files/02_serving/04_FileServer/01/main.go +++ b/023_serving-files/02_serving/04_FileServer/01/main.go @@ -7,11 +7,11 @@ import ( func main() { http.Handle("/", http.FileServer(http.Dir("."))) - http.HandleFunc("/dog", dog) + http.HandleFunc("/dog/", dog) http.ListenAndServe(":8080", nil) } func dog(w http.ResponseWriter, req *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") - io.WriteString(w, ``) + io.WriteString(w, ``) } From 84dcfc26bb901a9051f8d5add58a1a04b0ebad59 Mon Sep 17 00:00:00 2001 From: Mark Rosemaker <48681726+MarkRosemaker@users.noreply.github.com> Date: Fri, 13 Dec 2019 20:16:34 +0100 Subject: [PATCH 4/6] make new version work I've spend some time trying to figure out why it didn't work for me. The reason is that Google updated the system. Google's changes: - use main() instead of init() - specify go version in app.yaml - most other declarations in app.yaml now invalid - pass project name and version as flags in the gcloud command - python install not needed anymore Plus, you need ListenAndServe of course! ;) I can confirm that it now works with the changes I made to the files. --- 026_appengine-deploy/README.md | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/026_appengine-deploy/README.md b/026_appengine-deploy/README.md index 247ba1be..da3c87d6 100644 --- a/026_appengine-deploy/README.md +++ b/026_appengine-deploy/README.md @@ -4,27 +4,18 @@ https://domains.google/#/ # deploying to [Google Cloud](https://cloud.google.com/) - [install google appengine](https://cloud.google.com/appengine/docs/go/download) -- [make sure python is installed VERSION 2.7.x](https://www.python.org/downloads/release/python-2712/) - - python -V - configure environment PATH variables - google cloud developer console - create a project - get the project ID -- update the app.yaml file with your project ID +- set your go version in the app.yaml file ``` -application: temp-137512 -version: 1 -runtime: go -api_version: go1 - -handlers: -- url: /.* - script: _go_app +runtime: go113 ``` - deploy to that project ``` -appcfg.py -A -V v1 update . +gcloud app deploy app.yaml --project= -v 1 ``` - view your project - http://YOUR_PROJECT_ID.appspot.com/ From 304c653fbc7c6625f2a88a55bbea40987afe06a8 Mon Sep 17 00:00:00 2001 From: Mark Rosemaker <48681726+MarkRosemaker@users.noreply.github.com> Date: Fri, 13 Dec 2019 20:22:14 +0100 Subject: [PATCH 5/6] make new version work - Google now wants you to use main instead of init - don't forget to ListenAndServe --- 026_appengine-deploy/01/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/026_appengine-deploy/01/main.go b/026_appengine-deploy/01/main.go index 68523458..671d6b1d 100644 --- a/026_appengine-deploy/01/main.go +++ b/026_appengine-deploy/01/main.go @@ -4,6 +4,7 @@ import ( "net/http" ) -func init() { +func main() { http.Handle("/", http.FileServer(http.Dir("."))) + http.ListenAndServe(":8080", nil) } From f862b2b7bba75300c8c47eacab15b8933ae110a3 Mon Sep 17 00:00:00 2001 From: Mark Rosemaker <48681726+MarkRosemaker@users.noreply.github.com> Date: Fri, 13 Dec 2019 20:22:22 +0100 Subject: [PATCH 6/6] make new version work - Google now wants you to use main instead of init - don't forget to ListenAndServe --- 026_appengine-deploy/02/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/026_appengine-deploy/02/main.go b/026_appengine-deploy/02/main.go index 68523458..671d6b1d 100644 --- a/026_appengine-deploy/02/main.go +++ b/026_appengine-deploy/02/main.go @@ -4,6 +4,7 @@ import ( "net/http" ) -func init() { +func main() { http.Handle("/", http.FileServer(http.Dir("."))) + http.ListenAndServe(":8080", nil) }