A work in process library for making a small web framework. Heavily inspired by the Elixir Phoenix framework request pipelining and routing
The router library takes a request dict and takes the path element an a routes list. It will then determine which route matches and call the associated prefix command with the request dict as last parameter (or without if the prefix start with !)
While matching the route, parts which start with @ or : will match anything and the matched part will be stored in the req dict as params. The difference between @ and : is that @ will also match any following slashes.
Example:
set routes { /ivi/:id ivi::handler /ivi/:id/:subresource ivi::handler /svi/:vin svi::handler /soi/:id soi::handler /vicci/ihdcc/:code {vicci::handler ihdcc} /vicci/dcc/:code {vicci::handler dcc} /css/default.css {track::asset default.css text/css} / {track::md index.md} /console {!console show} /exit {!exit} /vagbearer vagbearer::handler @rest track::debug_req }