File: gingonic_router_test.go

package info (click to toggle)
golang-github-manyminds-api2go 1.0-RC4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 552 kB
  • sloc: sh: 23; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 432 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
21
22
23
24
25
26
// +build gingonic,!gorillamux,!echo

package api2go

import (
	"log"

	"github.com/gin-gonic/gin"
	"github.com/manyminds/api2go/routing"
)

func newTestRouter() routing.Routeable {
	gin.SetMode(gin.ReleaseMode)
	gg := gin.Default()
	notFound := func(c *gin.Context) {
		notAllowedHandler{}.ServeHTTP(c.Writer, c.Request)
	}

	gg.NoRoute(notFound)

	return routing.Gin(gg)
}

func init() {
	log.Println("Testing with gin router")
}