tailwind and docker update
This commit is contained in:
8
main.go
8
main.go
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/a-h/templ"
|
||||
"michaelthomson.dev/mthomson/go-todos-app/views"
|
||||
@@ -11,6 +12,13 @@ import (
|
||||
func main() {
|
||||
router := http.NewServeMux()
|
||||
|
||||
// Serve static files
|
||||
router.HandleFunc("GET /assets/", func(w http.ResponseWriter, r *http.Request) {
|
||||
filePath := r.URL.Path[len("/assets/"):]
|
||||
fullPath := filepath.Join(".", "assets", filePath)
|
||||
http.ServeFile(w, r, fullPath)
|
||||
})
|
||||
|
||||
home := views.Home()
|
||||
router.Handle("GET /", templ.Handler(home))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user