19 lines
441 B
Go
19 lines
441 B
Go
|
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")
|
||
|
}
|