init
This commit is contained in:
16
internal/server/health-check.go
Normal file
16
internal/server/health-check.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"madsky.ru/go-tracker/internal/server/response"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func (app *Application) getVersion(w http.ResponseWriter, r *http.Request) {
|
||||
s, err := app.Storage.ServerSettings.Find(app.Ctx)
|
||||
if err != nil {
|
||||
response.Error(w, err, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
response.WriteJSON(w, nil, http.StatusOK, &s)
|
||||
}
|
||||
Reference in New Issue
Block a user