handlers.go 334 B

1234567891011121314151617
  1. package server
  2. import (
  3. "net/http"
  4. "git.linuxit.ro/turos.robert/mynotes/lib/inout"
  5. )
  6. func Wildcard(w http.ResponseWriter, r *http.Request) {
  7. if r.Method != "GET" {
  8. w.Write(inout.FileToBytes("templates/index.tmpl"))
  9. return
  10. }
  11. w.WriteHeader(http.StatusMethodNotAllowed)
  12. w.Write(inout.FileToBytes("templates/error.tmpl"))
  13. }