func Example_Basic() {
	rackup := rack.New()
	rackup.Add(logger.New(os.Stdout, "", 0))
	rackup.Add(Logger)

	conn := httper.HttpConnection(":4009")
	go conn.Go(rackup)
	http.Get("http://localhost:4009/location")
	//output: GET /location
}
Exemplo n.º 2
0
func Example_Render() {
	rackup := rack.New()
	rackup.Add(logger.New(os.Stdout, "", 0))
	rackup.Add(templater.GetTemplates("./test_templates"))
	rackup.Add(rack.Func(func(vars map[string]interface{}, next func()) {
		vars["Object"] = "World"
		next()
	}))
	rackup.Add(Renderer{"test"})

	conn := httper.HttpConnection(":4010")
	go conn.Go(rackup)

	GetFrom("http://localhost:4010/")
	//output: Hello World
}