feat(routing): integrate new router into framework
This commit is contained in:
parent
d739157fb1
commit
e29e02ff85
9 changed files with 201 additions and 364 deletions
|
|
@ -21,15 +21,19 @@ lnm_http_step_err slow_step(lnm_http_conn *conn) {
|
|||
int main() {
|
||||
lnm_http_loop *hl;
|
||||
lnm_http_step *step = NULL;
|
||||
lnm_http_route *route;
|
||||
|
||||
lnm_http_loop_init(&hl, NULL, ctx_init,
|
||||
ctx_reset,
|
||||
ctx_free);
|
||||
|
||||
lnm_http_step_append(&step, slow_step, true);
|
||||
lnm_http_route_init_literal(&route, lnm_http_method_get, "/", step);
|
||||
lnm_http_loop_route_add(hl, route);
|
||||
lnm_http_router *router;
|
||||
lnm_http_router_init(&router);
|
||||
|
||||
lnm_http_route *route;
|
||||
lnm_http_router_add(&route, router, lnm_http_method_get, "/");
|
||||
lnm_http_route_step_append(route, slow_step, true);
|
||||
|
||||
lnm_http_loop_router_set(hl, router);
|
||||
|
||||
lnm_log_init_global();
|
||||
lnm_log_register_stdout(lnm_log_level_debug);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue