Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 421 Bytes

README.md

File metadata and controls

24 lines (19 loc) · 421 Bytes

plaintextrefresher

package main

import (
	"fmt"
	"github.com/Kimbsen/plaintextrefresher"
	"net/http"
)

func main() {
	http.HandleFunc("/", plaintextrefresher.Handle("/stats"))
	count := 0
	http.HandleFunc("/stats", func(rw http.ResponseWriter, req *http.Request) {
		rw.Header().Set("Content-Type", "text/html")
		fmt.Fprintf(rw, "Hello World %d", count)
		count++
	})
	http.ListenAndServe(":8080", nil)
}