knowyt/server/src/handler/internal.go
2021-08-02 09:52:47 +02:00

20 lines
299 B
Go

package handler
import (
"fmt"
"net/http"
"os"
"time"
)
func Exit(_ http.ResponseWriter, _ *http.Request) {
os.Exit(0)
}
func CreateVersionHandler() HandlerFunc {
startTime := time.Now().Unix()
return func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%d\n", startTime)
}
}