Esempio n. 1
0
func main() {
	pub := &Pub{relay.NewController("")}

	routes := relay.NewRoutes("")

	routes.RouteGET("/", pub.BindHTTP("", "/", pub.Index))
	http.ListenAndServe(":3030", routes)
}
Esempio n. 2
0
//NewEngine returns a new app configuration
func NewEngine(c *Config, init func(*Engine)) *Engine {
	eo := &Engine{
		Config:   c,
		Routes:   relay.NewRoutes(""),
		Template: assets.NewTemplateDir(&c.Templates),
		OnInit:   init,
	}

	eo.stop = makeDuration(c.Killbeat, 20)
	eo.heartbeat = makeDuration(c.Heartbeat, (10 * 60))

	return eo
}