Init
This commit is contained in:
26
lts.go
Normal file
26
lts.go
Normal file
@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
//go:embed tmpls/*
|
||||
var tmpls embed.FS
|
||||
|
||||
//go:embed etc/*
|
||||
var etc embed.FS
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
tmpl := template.Must(template.ParseFS(tmpls, "tmpls/*.html"))
|
||||
if err := tmpl.Execute(w, nil); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
})
|
||||
http.Handle("/etc/", http.FileServerFS(etc))
|
||||
|
||||
http.ListenAndServe(":9090", nil)
|
||||
}
|
Reference in New Issue
Block a user