Skip to content

Commit

Permalink
Merge pull request #10 from fulldump/feature/document-routing-example
Browse files Browse the repository at this point in the history
Extend doc with routing diagram
  • Loading branch information
fulldump committed Feb 17, 2016
2 parents 2ac3273 + 81e295b commit 74e5498
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Golax is the official go implementation for the _Lax_ framework.

- [About Lax](#about-lax)
- [Getting started](#getting-started)
- [Routing example](#routing-example)
- [Performance](#performance)
- [How interceptor works](#how-interceptor-works)
- [Handling parameters](#handling-parameters)
Expand Down Expand Up @@ -53,6 +54,20 @@ my_api.Root.Node("hello").
my_api.Serve()
```

## Routing example

Routing is based on nodes.

<p align="center">
<img src="doc/figure_4_routing_example.png">
</p>

There are three types: `static`, `regex` and `parameter`.

* static: Only matches with the url part if it is exactly the same.
* regex: Surrounded by `(` and `)`, if the regex match.
* parameter: Surrounded by `{` and `}`, always matches.

## Performance

The performance compared with the [most popular alternative](http://www.gorillatoolkit.org/) is very similar (actually _golax_ performs slightly better) however code readability and maintainability is far better with _golax_ implementation.
Expand Down
Binary file added doc/figure_4_routing_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74e5498

Please sign in to comment.