🎉 initial commit

This commit is contained in:
2021-01-13 23:39:00 +01:00
commit 8e9cbe797c
9 changed files with 161 additions and 0 deletions

23
server.go Normal file
View File

@@ -0,0 +1,23 @@
package main
import (
"net/http"
"github.com/gorilla/mux"
)
type server struct {
router *mux.Router
store Store
}
func newServer() *server {
s := &server{
router: mux.NewRouter(),
}
return s
}
func (s *server) serveHTTP(rw http.ResponseWriter, r *http.Request) {
logRequestMiddleware(s.router.ServeHTTP).ServeHTTP(rw, r)
}