File: httprouter.go

package info (click to toggle)
golang-github-appleboy-gofight 2.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 212 kB
  • sloc: makefile: 50
file content (20 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package example

import (
	"fmt"
	"github.com/julienschmidt/httprouter"
	"net/http"
)

func httpRouterHelloHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
	fmt.Fprint(w, "Hello World")
}

// HTTPRouterEngine is httprouter router.
func HTTPRouterEngine() http.Handler {
	r := httprouter.New()

	r.GET("/", httpRouterHelloHandler)

	return r
}