diff --git a/main.go b/main.go index 80af6c6..9c9a5cc 100644 --- a/main.go +++ b/main.go @@ -17,7 +17,7 @@ import ( var embedFS embed.FS func run() error { - storage, err := newStore() + store, err := newStore() if err != nil { return err } @@ -36,13 +36,13 @@ func run() error { mux.Handle( "POST /api/password", middlewares.RateLimiter( - routes.CreatePassword(storage, maxPasswordLength), + routes.CreatePassword(store, maxPasswordLength), 1*time.Minute, 5, ), ) - mux.Handle("GET /api/password/{id}", routes.GetPassword(storage)) - mux.Handle("HEAD /api/password/{id}", routes.HasPassword(storage)) + mux.Handle("GET /api/password/{id}", routes.GetPassword(store)) + mux.Handle("HEAD /api/password/{id}", routes.HasPassword(store)) if logRequests { handler = middlewares.Logger(handler)