diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3fee776 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module git.thirdmartini.com/pub/snap + +go 1.15 + +require ( + git.thirdmartini.com/pub/fancylog v0.0.0-20180118031448-3f3ebedd6016 + github.com/gorilla/mux v1.8.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..ede51a7 --- /dev/null +++ b/go.sum @@ -0,0 +1,3 @@ +git.thirdmartini.com/pub/fancylog v0.0.0-20180118031448-3f3ebedd6016/go.mod h1:nxr8UYB5P+7cpJPpqcbhMjfqm+GH3VDZQs2dFWibA68= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= diff --git a/server.go b/server.go index a5598d8..b684942 100644 --- a/server.go +++ b/server.go @@ -7,7 +7,6 @@ import ( "io/ioutil" "net/http" "os" - "path" "path/filepath" "strings" "time" @@ -15,6 +14,7 @@ import ( "github.com/gorilla/mux" "git.thirdmartini.com/pub/fancylog" + "git.thirdmartini.com/pub/snap/auth" ) @@ -119,7 +119,7 @@ func (s *Server) parseTemplates(t *template.Template, filenames ...string) (*tem func (s *Server) loadTemplates() *template.Template { tmpl := template.New("") - err := filepath.Walk(path.Join(s.path, s.templates), func(path string, info os.FileInfo, err error) error { + err := filepath.Walk(s.templates, func(path string, info os.FileInfo, err error) error { if strings.Contains(path, ".html") { _, err := s.parseTemplates(tmpl, path) if err != nil { diff --git a/server_test.go b/server_test.go new file mode 100644 index 0000000..f658f89 --- /dev/null +++ b/server_test.go @@ -0,0 +1,10 @@ +package snap + +import ( + "testing" +) + +func TestServer(t *testing.T) { + + +}