From a551bd14ba7daa48c0c7409001710ed9f57c8046 Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Mon, 20 Jun 2016 11:38:09 -0400 Subject: Add webapp --- todo.go | 2 +- todolist/webapp.go | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/todo.go b/todo.go index 3beccc8..0240886 100644 --- a/todo.go +++ b/todo.go @@ -10,7 +10,7 @@ import ( ) const ( - VERSION = "0.1.0" + VERSION = "0.2.0" ) func main() { diff --git a/todolist/webapp.go b/todolist/webapp.go index 29918bf..302be58 100644 --- a/todolist/webapp.go +++ b/todolist/webapp.go @@ -9,6 +9,10 @@ import ( "github.com/julienschmidt/httprouter" ) +const ( + VERSION = "0.2.0" +) + type Webapp struct { Router *httprouter.Router } @@ -32,13 +36,42 @@ func setupRoutes() *httprouter.Router { func Scaffold(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { template := ` - -

you are here buddy

+ + + + + + + + + Todolist + + + +
+ + + ` fmt.Fprintf(w, template) } +func urlFor(file string) string { + return "http://d26ykxqbemi1kc.cloudfront.net/" + VERSION + "/" + file +} + func GetTodos(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { w.Header().Set("Access-Control-Allow-Origin", "*") app := NewApp() -- cgit v1.3