Serving Multiple Sites
Installation
go get github.com/go-macaron/switcherUsage
func main() {
m1 := macaron.Classic()
// Register m1 middlewares and routers.
m2 := macaron.Classic()
// Register m2 middlewares and routers.
hs := switcher.NewHostSwitcher()
// Set instance corresponding to host address.
hs.Set("gowalker.org", m1)
hs.Set("gogs.io", m2)
hs.Run()
}Dynamic match
Last updated
Was this helpful?