0
0
zero-blog/main.go
Gibheer ce036f428d add basic middleware handling
This is an initial spike on how the middleware might be included into
the system. It is inspired/copied from GIN, so I still have to work out,
how to make it nicer than it is at the moment.

What is currently missing is Aborting and the addRoute function looks
very ugly.
2014-08-01 07:58:33 +02:00

18 lines
329 B
Go

package main
import (
"fmt"
"github.com/gibheer/zero-blog/lib"
"github.com/gibheer/zero-blog/controller"
)
func main() {
router := lib.NewRouter()
router.Use(func(c *lib.Context) error {
fmt.Fprint(c.Response, "Hello says the middleware!")
return nil
})
controller.DefineRoutes(router)
router.Start()
}