Add '18-expenses-chart/' from commit '78c9bd1d614c8bdd25a3e1d23bd0a39bb01e65f1'
git-subtree-dir: 18-expenses-chart git-subtree-mainline:e13fa186e1git-subtree-split:78c9bd1d61
This commit is contained in:
21
18-expenses-chart/main.go
Normal file
21
18-expenses-chart/main.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user