Last active
August 29, 2015 14:18
-
-
Save errzey/213559e2bccf43bcf779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evhtpexp app = express(); | |
express_cb_s foocb = onGet(app, "/foo", | |
func void(evreq r, void * a) { | |
reply(r, "FOOO"); | |
}); | |
express_cb_s barcb = onGet(app, "/bar", | |
func void(evreq r, void * a) { | |
reply(r, "BARRR"); | |
}); | |
onData(app, | |
onGet(app, "/baz", | |
func void (evreq r, void * a) { | |
reply(r, "BAZ"); | |
}), | |
func evhtp_res(evreq r, evbuf_t * buf, void * a) { | |
printf("Got data baz %s\n", (char *)evbuffer_pullup(buf, -1)); | |
return EVHTP_RES_OK; | |
}); | |
onData(app, foocb, | |
func evhtp_res(evreq r, evbuf_t * buf, void * a) { | |
printf("Got data %s\n", (char *)evbuffer_pullup(buf, -1)); | |
return EVHTP_RES_OK; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment