22 lines
419 B
Go
22 lines
419 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
|
|
"sunshine.industries/temp-exercise/templates"
|
|
"github.com/a-h/templ"
|
|
)
|
|
|
|
func main() {
|
|
component := templates.Hello("some name")
|
|
|
|
http.Handle("/", templ.Handler(component))
|
|
|
|
staticFs := http.FileServer(http.Dir("./static"))
|
|
http.Handle("/static/", http.StripPrefix("/static/", staticFs))
|
|
|
|
fmt.Println("starting to serve on :3000")
|
|
http.ListenAndServe(":3000", nil)
|
|
}
|