Skip to content

Instantly share code, notes, and snippets.

@DaveAppleton
Created April 1, 2020 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaveAppleton/124f23cf276ed1251a886df6f23e63ca to your computer and use it in GitHub Desktop.
Save DaveAppleton/124f23cf276ed1251a886df6f23e63ca to your computer and use it in GitHub Desktop.
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