created simple webserver
This commit is contained in:
@@ -0,0 +1 @@
|
||||
*.test
|
||||
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func healthHandler(w http.ResponseWriter, r *http.Request) {
|
||||
io.WriteString(w, "ok")
|
||||
}
|
||||
|
||||
func routes(internalMux *http.ServeMux) {
|
||||
internalMux.HandleFunc("/health", healthHandler)
|
||||
}
|
||||
|
||||
func main() {
|
||||
backslashMux := http.NewServeMux()
|
||||
routes(backslashMux)
|
||||
log.Fatal(http.ListenAndServe(":8080", backslashMux))
|
||||
}
|
||||
Reference in New Issue
Block a user