created simple webserver

This commit is contained in:
2026-10-05 13:22:09 +01:00
parent c12177d887
commit ede76f3dbd
4 changed files with 25 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
*.test
Executable
BIN
View File
Binary file not shown.
+21
View File
@@ -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))
}
+3
View File
@@ -0,0 +1,3 @@
module tea.ahmza.com/ahmza.com/backslash
go 1.27