2024-02-10 11:59:58 +00:00
|
|
|
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")
|
2024-02-10 17:35:16 +00:00
|
|
|
r.HandleFunc("/settings", pages.Settings).Methods("GET")
|
2024-02-10 11:59:58 +00:00
|
|
|
|
|
|
|
log.Println("Server started on :8000")
|
|
|
|
log.Fatal(http.ListenAndServe(":8000", r))
|
|
|
|
}
|