diff options
| -rw-r--r-- | handlers.go | 8 | ||||
| -rw-r--r-- | handlers_test.go | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/handlers.go b/handlers.go index 35e4998..a0d98e4 100644 --- a/handlers.go +++ b/handlers.go @@ -17,8 +17,8 @@ var frontendEmbed embed.FS func registerHandlers(r *mux.Router, db *sql.DB) { r.Handle("/api/version", version(db)) - r.Handle("/api/registration", register(db)) - r.Handle("/api/authentication", authenticate(db)) + r.Handle("/api/registration", ApiRegistration(db)) + r.Handle("/api/authentication", ApiAuthentication(db)) // frontend must come last to make sure /api takes precedence frontend, err := fs.Sub(frontendEmbed, "build/frontend/public") @@ -34,7 +34,7 @@ func version(db *sql.DB) http.Handler { }) } -func register(db *sql.DB) http.Handler { +func ApiRegistration(db *sql.DB) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { var data struct { Username string @@ -72,7 +72,7 @@ func register(db *sql.DB) http.Handler { }) } -func authenticate(db *sql.DB) http.Handler { +func ApiAuthentication(db *sql.DB) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { var data struct { Username string diff --git a/handlers_test.go b/handlers_test.go index c539b60..db97502 100644 --- a/handlers_test.go +++ b/handlers_test.go @@ -82,7 +82,7 @@ func TestHTTPRegister(t *testing.T) { return db } - testHandler(t, register, cases, setup) + testHandler(t, ApiRegistration, cases, setup) } func TestHTTPAuthenticate(t *testing.T) { @@ -112,5 +112,5 @@ func TestHTTPAuthenticate(t *testing.T) { return db } - testHandler(t, authenticate, cases, setup) + testHandler(t, ApiAuthentication, cases, setup) } |
