sonarqube-badges/router/views/index.go

19 lines
441 B
Go
Raw Normal View History

2025-03-13 08:25:39 +01:00
package views
import (
"github.com/gorilla/mux"
"net/http"
"sonarqube-badge/router/middlewares"
"sonarqube-badge/templates"
)
func getIndex(res http.ResponseWriter, req *http.Request) {
templates.Layout(templates.Index(), "Index").Render(req.Context(), res)
}
func IndexRouter(r *mux.Router) {
subrouter := r.PathPrefix("").Subrouter()
subrouter.Use(middlewares.CheckJwtToken)
subrouter.HandleFunc("/", getIndex).Methods("GET")
}