lemserv/lemserv.go
2023-02-19 21:13:19 +01:00

19 lines
393 B
Go

package main
import (
"fmt"
"net/http"
)
func main() {
http.Handle("/", http.FileServer(http.Dir("./wwwdata/")))
http.HandleFunc("/mything", handleSomething)
if err := http.ListenAndServe(":8088", nil); err != http.ErrServerClosed {
fmt.Printf("Ouch, server closed: %v\n", err)
}
}
func handleSomething(w http.ResponseWriter, r *http.Request) {
fmt.Println("Wohooo, a request!")
}