Skip to content

Commit

Permalink
Updated for go111.
Browse files Browse the repository at this point in the history
  • Loading branch information
zond committed Feb 6, 2020
1 parent cd67f59 commit 5e6a5d1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
25 changes: 25 additions & 0 deletions gae/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
5 changes: 2 additions & 3 deletions gae/app.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
runtime: go
api_version: go1
runtime: go111

handlers:
- url: /.*
script: _go_app
script: auto
2 changes: 1 addition & 1 deletion gae/common.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gae
package main

import (
"github.com/zond/godip"
Expand Down
6 changes: 4 additions & 2 deletions gae/router.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gae
package main

import (
"encoding/json"
Expand All @@ -7,6 +7,7 @@ import (

"github.com/gorilla/mux"
"github.com/zond/godip/variants"
"google.golang.org/appengine"
)

func corsHeaders(w http.ResponseWriter) {
Expand Down Expand Up @@ -80,12 +81,13 @@ func listVariants(w http.ResponseWriter, r *http.Request) {
}
}

func init() {
func main() {
r := mux.NewRouter()
r.Methods("OPTIONS").HandlerFunc(preflight)
variants := r.Path("/{variant}").Subrouter()
variants.Methods("POST").HandlerFunc(resolve)
variants.Methods("GET").HandlerFunc(start)
r.Path("/").HandlerFunc(listVariants)
http.Handle("/", r)
appengine.Main()
}

0 comments on commit 5e6a5d1

Please sign in to comment.