watchyourlan/internal/web/index-home.go
2023-01-05 13:41:11 +07:00

23 lines
471 B
Go

package web
import (
"net/http"
"github.com/aceberg/WatchYourLAN/internal/db"
"github.com/aceberg/WatchYourLAN/internal/models"
)
func indexHandler(w http.ResponseWriter, r *http.Request) {
var guiData models.GuiData
guiData.Config = AppConfig
guiData.Hosts = AllHosts
guiData.Icon = Icon
execTemplate(w, "index", guiData)
}
func homeHandler(w http.ResponseWriter, r *http.Request) {
AllHosts = db.Select(AppConfig.DbPath)
http.Redirect(w, r, "/", 302)
}