rename storage variables to store
This commit is contained in:
parent
e51a5f4fd7
commit
a7392da5fb
1 changed files with 4 additions and 4 deletions
8
main.go
8
main.go
|
@ -17,7 +17,7 @@ import (
|
||||||
var embedFS embed.FS
|
var embedFS embed.FS
|
||||||
|
|
||||||
func run() error {
|
func run() error {
|
||||||
storage, err := newStore()
|
store, err := newStore()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,13 @@ func run() error {
|
||||||
mux.Handle(
|
mux.Handle(
|
||||||
"POST /api/password",
|
"POST /api/password",
|
||||||
middlewares.RateLimiter(
|
middlewares.RateLimiter(
|
||||||
routes.CreatePassword(storage, maxPasswordLength),
|
routes.CreatePassword(store, maxPasswordLength),
|
||||||
1*time.Minute,
|
1*time.Minute,
|
||||||
5,
|
5,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
mux.Handle("GET /api/password/{id}", routes.GetPassword(storage))
|
mux.Handle("GET /api/password/{id}", routes.GetPassword(store))
|
||||||
mux.Handle("HEAD /api/password/{id}", routes.HasPassword(storage))
|
mux.Handle("HEAD /api/password/{id}", routes.HasPassword(store))
|
||||||
|
|
||||||
if logRequests {
|
if logRequests {
|
||||||
handler = middlewares.Logger(handler)
|
handler = middlewares.Logger(handler)
|
||||||
|
|
Loading…
Reference in a new issue