|
1 | 1 | # Jester changelog
|
2 | 2 |
|
| 3 | +## 0.3.0 - 06/07/2018 |
| 4 | + |
| 5 | +This is a major new release containing many changes and improvements. |
| 6 | +Primary new addition is support for the brand new HttpBeast server which offers |
| 7 | +unparalleled performance and scalability across CPU cores. |
| 8 | + |
| 9 | +### Modular routes |
| 10 | + |
| 11 | +Routes can now be separated into multiple `router` blocks and each block |
| 12 | +can be placed inside a separate module. For example: |
| 13 | + |
| 14 | +```nim |
| 15 | +import jester |
| 16 | +
|
| 17 | +router api: |
| 18 | + get "/names": |
| 19 | + resp "Dom,George,Charles" |
| 20 | +
|
| 21 | + get "/info/@name": |
| 22 | + resp @"name" |
| 23 | +
|
| 24 | +routes: |
| 25 | + extend api, "/api" |
| 26 | +``` |
| 27 | + |
| 28 | +The `api` routes are all prefixed with `/api`, for example |
| 29 | +https://localhost:5000/api/names. |
| 30 | + |
| 31 | +### Error handlers |
| 32 | + |
| 33 | +Errors including exceptions and error HTTP codes can now be handled. |
| 34 | +For example: |
| 35 | + |
| 36 | +```nim |
| 37 | +import jester |
| 38 | +
|
| 39 | +routes: |
| 40 | + error Http404: |
| 41 | + resp Http404, "Looks you took a wrong turn somewhere." |
| 42 | +
|
| 43 | + error Exception: |
| 44 | + resp Http500, "Something bad happened: " & exception.msg |
| 45 | +``` |
| 46 | + |
| 47 | +### Meta routes |
| 48 | + |
| 49 | +Jester now supports `before` and `after` routes. So you can easily perform |
| 50 | +actions before or after requests, you don't have to specify a pattern if you |
| 51 | +want the handler to run before/after all requests. For example: |
| 52 | + |
| 53 | +```nim |
| 54 | +import jester |
| 55 | +
|
| 56 | +routes: |
| 57 | + before: |
| 58 | + resp Http200, "<xml></xml>", "text/xml" |
| 59 | +
|
| 60 | + get "/test": |
| 61 | + result[3] = "<content>foobar</content>" |
| 62 | +``` |
| 63 | + |
| 64 | + |
| 65 | +### Other changes |
| 66 | + |
| 67 | +* **Breaking change:** The `body`, `headers`, `status` templates have been |
| 68 | + removed. These may be brought back in the future. |
| 69 | +* Templates and macros now work in routes. |
| 70 | +* HttpBeast support. |
| 71 | +* SameSite support for cookies. |
| 72 | +* Multi-core support. |
| 73 | + |
| 74 | +## 0.2.0 - 02/09/2017 |
| 75 | + |
3 | 76 | ## 0.1.1 - 01/10/2016
|
4 | 77 |
|
5 | 78 | This release contains small improvements and fixes to support Nim 0.15.0.
|
|
0 commit comments