Example #1
0
File: main.go Project: Andals/gpm
func main() {
	cl := controller.NewController()

	cl.BeforeAction(beforeAction)
	cl.AfterAction(afterAction)

	cl.ExactMatchAction("/exact", exactAction)
	cl.RegexMatchAction("^/[a-z]+([0-9]+)", regexAction)

	gracehttp.ListenAndServe(":8001", cl)
}
Example #2
0
File: main.go Project: Andals/gobox
func main() {
	cl := controller.NewController()

	cl.AddBeforeAction("^/exact", beforeAction).
		AddAfterAction("^/([a-z]+)[0-9]+", afterAction).
		AddExactMatchAction("/exact", exactAction).
		AddExactMatchAction("/redirect", redirectAction).
		AddRegexMatchAction("^/[a-z]+([0-9]+)", regexAction).
		AddDestructFunc("^/([a-z]+)[0-9]+", destruct)

	gracehttp.ListenAndServe(":8001", cl)
}