feat: Added first chapter sources
This commit is contained in:
parent
3b16737003
commit
f7d9b3ffc7
BIN
assets/logo.png
Normal file
BIN
assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
7
index.html
Normal file
7
index.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<html>
|
||||
|
||||
<body>
|
||||
<h1>Welcome to Chirpy</h1>
|
||||
</body>
|
||||
|
||||
</html>
|
22
main.go
Normal file
22
main.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
mux := http.NewServeMux()
|
||||
fileServer := http.FileServer(http.Dir("."))
|
||||
mux.Handle("/app", http.StripPrefix("/app", fileServer))
|
||||
mux.Handle("/app/assets/", http.StripPrefix("/app/assets/", http.FileServer(http.Dir("./assets/"))))
|
||||
mux.HandleFunc("/healthz", func(w http.ResponseWriter, req *http.Request) {
|
||||
req.Header.Set("Content-Type", "text/plain; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("OK"))
|
||||
})
|
||||
server := &http.Server{
|
||||
Addr: ":8080",
|
||||
Handler: mux,
|
||||
}
|
||||
server.ListenAndServe()
|
||||
}
|
Loading…
Reference in New Issue
Block a user