You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
490 B
22 lines
490 B
package web
|
|
|
|
import (
|
|
"database/sql"
|
|
"encoding/json"
|
|
"net/http"
|
|
|
|
"github.com/domagojzecevic/cammonitor/internal/config"
|
|
"github.com/go-chi/chi/v5"
|
|
)
|
|
|
|
func NewRouter(_ *config.Config, _ *sql.DB, _ any) chi.Router {
|
|
router := chi.NewRouter()
|
|
|
|
router.Get("/health", func(w http.ResponseWriter, _ *http.Request) {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.WriteHeader(http.StatusOK)
|
|
_ = json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
|
|
})
|
|
|
|
return router
|
|
}
|
|
|