Dodavanje base šablona, sidebara, topbara i dashboard stranice

This commit is contained in:
2026-06-01 01:11:05 +02:00
parent 56accffb37
commit 3b9e0c081a
7 changed files with 326 additions and 2 deletions
+8 -2
View File
@@ -1,13 +1,13 @@
package main
import (
"fmt"
"log"
"net/http"
"os"
"ntech/internal/config"
"ntech/internal/db/sqlite"
"ntech/internal/handler"
"github.com/go-chi/chi/v5"
"github.com/joho/godotenv"
@@ -48,9 +48,15 @@ func main() {
log.Println("Migracije uspešno izvršene")
r := chi.NewRouter()
// statični fajlovi — CSS, JS, slike
r.Handle("/static/*", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static"))))
// rute
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Zdravo iz NTech-a")
http.Redirect(w, r, "/dashboard", http.StatusFound)
})
r.Get("/dashboard", handler.Dashboard)
log.Printf("NTech pokrenut na portu %s", port)
err = http.ListenAndServe(":"+port, r)