This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package geowebgap | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "html/template" | |
| "log" | |
| "net/http" | |
| "net/url" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "gopkg.in/mgo.v2" | |
| "gopkg.in/mgo.v2/bson" | |
| "log" | |
| "os" | |
| ) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "html/template" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| "log" | |
| "net/http" | |
| "os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func init() { | |
| http.HandleFunc("/", handleRoot) | |
| } | |
| func serveError(c appengine.Context, w http.ResponseWriter, err error) { | |
| w.WriteHeader(http.StatusInternalServerError) | |
| w.Header().Set("Content-Type", "text/plain") | |
| io.WriteString(w, "Internal Server Error") | |
| c.Errorf("%v", err) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var rootTemplate = template.Must(template.New("root").Parse(rootTemplateHTML)) | |
| const rootTemplateHTML = ` | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <link rel="stylesheet" href="css/upper.css"> | |
| <title>Upload your Photo</title> | |
| </head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func handleUpload(w http.ResponseWriter, r *http.Request) { | |
| c := appengine.NewContext(r) | |
| blobs, _, err := blobstore.ParseUpload(r) | |
| if err != nil { | |
| serveError(c, w, err) | |
| return | |
| } | |
| file := blobs["file"] | |
| if len(file) == 0 { | |
| c.Errorf("no file uploaded") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func handleServe(w http.ResponseWriter, r *http.Request) { | |
| // Instantiate blobstore reader | |
| reader := blobstore.NewReader(appengine.NewContext(r), | |
| appengine.BlobKey(r.FormValue("blobKey"))) | |
| lat, lng, _ := getLatLng(reader) | |
| blobstore.Delete(appengine.NewContext(r), | |
| appengine.BlobKey(r.FormValue("blobKey"))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a comment | |
| # application is mandatory | |
| application: blobstrex-1081 | |
| # version is mandatory | |
| version: 1-0 | |
| # runtime is mandatory | |
| runtime: go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| background-color: #C2A7F2; | |
| font-family: sans-serif; | |
| } | |
| h1 { | |
| color: #2A1959; | |
| border-bottom: 2px solid #2A1959; | |
| } | |
| h2 { | |
| color: #474B94; |