arnaucube
arnaucube/goImgServerPublic Self-hosted repository
goImgServer/routes.go
routes.goRaw
 1package main
 2
 3import (
 4	"net/http"
 5)
 6
 7type Route struct {
 8	Name        string
 9	Method      string
10	Pattern     string
11	HandlerFunc http.HandlerFunc
12}
13
14type Routes []Route
15
16var routes = Routes{
17	Route{
18		"Index",
19		"GET",
20		"/",
21		Index,
22	},
23	Route{
24		"ImageShow",
25		"GET",
26		"/images/{imageName}",
27		ImageShow,
28	},
29	Route{
30		"NewImage",
31		"POST",
32		"/image",
33		NewImage,
34	},
35}