func start() {
templates = template.Must(template.ParseGlob(templateDir + "pages/*.gohtml"))
templates = template.Must(templates.ParseGlob(templateDir + "partials/*.gohtml"))
http.HandleFunc("/", home)
http.HandleFunc("/add", add)
fmt.Printf("Listening on http://localhost%s\n", port)
log.Fatal(http.ListenAndServe(port, nil))
}
var templates *template.Template
func main() {
explorer.Start()
}
const (
port string = ":4000"
templateDir string = "explorer/templates/"
)
강의 출처 : 노마드코더 노마드 코인
[Nomad Coin] Rest API - #6.0 Setup (0) | 2022.07.19 |
---|---|
[Nomad Coin] Explorer - #5.6 Recap (0) | 2022.07.18 |
[Nomad Coin] Explorer - #5.4 Adding A Block (0) | 2022.07.18 |
[Nomad Coin] Explorer - #5.3 Using Partials (0) | 2022.07.18 |
[Nomad Coin] Explorer - #5.2 Rendering Templates (0) | 2022.07.17 |
댓글 영역