-
Notifications
You must be signed in to change notification settings - Fork 1
HTTP Routing
Routing rules is the result parsed from file config/router.lisp
. Here is an example:
((:get "/foobar" foobar::foobar))
Each element in the top-level list form is a routing rule. The first, second and third part of a rule are HTTP method, path pattern and action name respectively.
The HTTP method is a keyword. :get
matches GET
, :post
matches POST
, etc.
The second part of routing rule, path pattern, is either a string or a list whose first element if one of the following keywords:
:normal
:regexp
:strict
If the first element is :normal
, the path of request matches the pattern if they're equivalent according to function CL:STRING=
, except the slash character at the end if exists. For example, request's path /foobar
and /foobar/
both match the pattern (:normal "/foobar")
.
If the first element is :regexp
, the path of request matches the pattern if the path contains a sub-string matches against the regular expression pattern. For example, request's path /post/abc
and /post/def
both matches the pattern (:regexp "/post/\\w+")
.
:strict
is similar to :normal
, except that in this mode the slash character at the end is unignorable.
The name of the function will be invoked when the rule matched
- Home
- Getting Started
- Basic Usage
- Advanced Topics
- APIs
- eloquent.mvc.config
- eloquent.mvc.controller