zdravko/cmd/server/main.go

25 lines
502 B
Go
Raw Normal View History

package main
import (
"log"
"net/http"
"github.com/gorilla/mux"
"code.tjo.space/mentos1386/zdravko/internal"
"code.tjo.space/mentos1386/zdravko/internal/pages"
)
func main() {
r := mux.NewRouter()
// Server static files
r.PathPrefix("/static/").Handler(http.FileServer(http.FS(internal.Static)))
r.HandleFunc("/", pages.Index).Methods("GET")
r.HandleFunc("/settings", pages.Settings).Methods("GET")
log.Println("Server started on :8000")
log.Fatal(http.ListenAndServe(":8000", r))
}