This repository has been archived on 2025-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
shop/app/controllers/routes.go
2023-11-10 15:57:52 +01:00

16 lines
424 B
Go

package controllers
import (
"github.com/gorilla/mux"
"net/http"
)
func (server *Server) initializeRoutes() {
server.Router = mux.NewRouter()
server.Router.HandleFunc("/", server.Home).Methods("GET")
staticFileDirectory := http.Dir("./assets/")
staticFileHandler := http.StripPrefix("/public/", http.FileServer(staticFileDirectory))
server.Router.PathPrefix("/public/").Handler(staticFileHandler).Methods("GET")
}