diff --git a/server.go b/server.go index 95c38c6..d9f2c3b 100644 --- a/server.go +++ b/server.go @@ -1,7 +1,6 @@ package main import ( - "encoding/json" "flag" "fmt" "log" @@ -13,22 +12,11 @@ import ( const CANVAS_WIDTH = 1000 const CANVAS_HEIGHT = 1000 -type Canvas struct { - Data [CANVAS_WIDTH * CANVAS_HEIGHT]byte `json:"data"` - Width int `json:"width"` - Height int `json:"height"` -} - type Server struct { // Registered user information Users map[string]UserData // Login sessions Sessions *sessions.CookieStore - Canvas Canvas -} - -func (s *Server) canvas(w http.ResponseWriter, r *http.Request) { - json.NewEncoder(w).Encode(s.canvas) } func main() { @@ -43,13 +31,6 @@ func main() { server := Server{ Users: make(map[string]UserData), Sessions: sessions.NewCookieStore(secret), - Canvas: Canvas{}, - } - - for x := 0; x < CANVAS_WIDTH; x++ { - for y := 0; y < CANVAS_HEIGHT; y++ { - server.Canvas.Data[y*CANVAS_HEIGHT+x] = byte(CANVAS_WIDTH / x) - } } // Host static files @@ -66,7 +47,7 @@ func main() { http.Redirect(w, r, "/", http.StatusFound) }) http.HandleFunc("/secret", server.secret) - http.HandleFunc("/canvas", canvas) + http.HandleFunc("/confirm-email", server.handle_confirmation) // Start web server at 127.0.0.1:8080 fmt.Printf("Listening to %s on port %s...\n", address, port) err := http.ListenAndServe(address+":"+port, nil) diff --git a/static/register.html b/static/register.html index 2dd9030..2a566b3 100644 --- a/static/register.html +++ b/static/register.html @@ -12,7 +12,7 @@