Beispiel #1
0
func StreamHandler(resp *dapper.Responder, req *dapper.Request) {
	messages := make(chan []byte)

	go func() {
		for {
			messages <- []byte("howdy!")
		}
	}()

	resp.Stream(messages)
}
Beispiel #2
0
func OtherHandler(resp *dapper.Responder, req *dapper.Request) {
	resp.Respond([]byte("hello"), 200)
}
Beispiel #3
0
func HomeHandler(resp *dapper.Responder, req *dapper.Request) {
	resp.Respond([]byte("home page"), 200)
}
Beispiel #4
0
func Handler(resp *dapper.Responder, req *dapper.Request) {
	filename := req.Params["filename"]

	resp.Respond([]byte(filename), 200)
}