{"size": 1170, "ext": "scrbl", "max_stars_repo_path": "vela-doc/vela/url.scrbl", "max_stars_repo_name": "worktopia-io/vela", "max_stars_repo_stars_event_min_datetime": "2019-04-29T12:41:38.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-22T06:25:33.000Z", "max_issues_repo_path": "vela-doc/vela/url.scrbl", "max_issues_repo_name": "worktopia-io/vela", "max_issues_repo_issues_event_min_datetime": "2020-02-14T10:23:15.000Z", "max_issues_repo_issues_event_max_datetime": "2020-04-09T11:04:43.000Z", "max_forks_repo_path": "vela-doc/vela/url.scrbl", "max_forks_repo_name": "nuty/vela", "max_forks_repo_forks_event_min_datetime": "2020-04-09T06:47:23.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-25T10:33:06.000Z"}
{"max_stars_count": 48, "max_issues_count": 2, "max_forks_count": 3, "avg_line_length": 20.8928571429, "max_line_length": 195, "alphanum_fraction": 0.5957264957}
#lang scribble/manual
@title[#:style '(toc)]{Routing}

Modern web applications use meaningful URLs to help users. Users are more likely to like a page and come back if the page uses a meaningful URL they can remember and use to directly visit a page.

bascly you need two function to define routers.


@defproc[#:link-target? #f
        (urls [url list?])
         (listof url)]


@defproc[#:link-target? #f
          (url 
            [path string?] 
            [handler procedure?] 
            [on-request list-of-procedure?] 
            [on-response list-of-procedure?]
            [end-point string?])
         (listof argument)]



@bold{
   url-group to grouping the routers
}


@defproc[#:link-target? #f
        (url-group 
            [prefix string?] 
            [on-request list-of-procedure?] 
            [on-response list-of-procedure?])
         (listof url)]

the on-request and on-request arguments are keyword arguments.

@bold{
    Example
}


@codeblock|{
(define api-v1 
  (url-group "/api/v1"))

(define routers
  (urls
    (url "/" index "index")

    (api-v1
      (url "/index" index)
      (url "/index1" index #:on-request "index1"))))
}|
