Created
April 1, 2020 23:46
-
-
Save DaveAppleton/73f03304e8151054536a0e790f55192d to your computer and use it in GitHub Desktop.
Simple server used to demonstrate CADDY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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