package main

import (
	"log"
	"net/http"
	"text/template"
)

type server struct {
	template *template.Template
}

func main() {
	t := template.Must(template.ParseFiles("templates/main.tpl"))
	s := server{template: t}
	http.HandleFunc("/", s.handler)
	log.Fatal(http.ListenAndServe(":8080", nil))
}

func (s *server) handler(w http.ResponseWriter, r *http.Request) {
	err := s.template.Execute(w, "Devoxx")
	if err != nil {
		log.Println(err)
	}
}