-var hashKey = securecookie.GenerateRandomKey(32)
-var blockKey = securecookie.GenerateRandomKey(32)
-var secureCookie = securecookie.New(hashKey, blockKey)
+func init() {
+ // Change the current working directory to two directories up from this
+ // source file so that we can read templates.
+ _, filename, _, _ := runtime.Caller(0)
+ cwd := filepath.Join(filepath.Dir(filename), "../..")
+ if err := os.Chdir(cwd); err != nil {
+ log.Fatal(err)
+ }
+
+ templates = template.Must(template.ParseFiles(
+ filepath.Join(cwd, "templates/bug_chomper.html"),
+ filepath.Join(cwd, "templates/submitted.html"),
+ filepath.Join(cwd, "templates/error.html"),
+ ))
+}