Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple server used to demonstrate CADDY
package main
import (
"fmt"
"net/http"
"time"
)
func main() {
http.HandleFunc("/api/test",func(w http.ResponseWriter, r * http.Request){ fmt.Fprintf(w,"test")})
http.HandleFunc("/api/time",func(w http.ResponseWriter, r * http.Request){ fmt.Fprintf(w,time.Now().Format("02 Jan 2006"))})
http.ListenAndServe(":8001",nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment