<commit_before># Koa Trie Router

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Gittip][gittip-image]][gittip-url]

## About

[Trie](http://en.wikipedia.org/wiki/Trie) routing for Koa based on [routington](https://github.com/jonathanong/routington).

Routes are orthogonal and strict, so the order of definition doesn't matter.  
Unlike regexp routing, there's no wildcard routing and you can't `next` to the next matching route.

See [routington](https://github.com/jonathanong/routington) for more details.

## Versions

+ **Koa@1** is compatible with `1.x.x` versions of Trie-router
+ **Koa@2** is compatible with `2.x.x` versions

## Features

+ Express-style routing using `router.get`, `router.put`, `router.post`, etc
+ Named URL parameters
+ Responds to `OPTIONS` requests with allowed methods
+ Multiple route middleware
+ Multiple routers
+ Nestable routers
+ `405 Method Not Allowed` support
+ `501 Not Implemented` support

## Usage<commit_msg>A note about trailing slash handling was added<commit_after># Koa Trie Router

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Gittip][gittip-image]][gittip-url]

## About

[Trie](http://en.wikipedia.org/wiki/Trie) routing for Koa based on [routington](https://github.com/jonathanong/routington).

Routes are orthogonal and strict, so the order of definition doesn't matter.  
Unlike regexp routing, there's no wildcard routing and you can't `next` to the next matching route.

See [routington](https://github.com/jonathanong/routington) for more details.

## Versions

+ **Koa@1** is compatible with `1.x.x` versions of Trie-router
+ **Koa@2** is compatible with `2.x.x` versions

## Features

+ Express-style routing using `router.get`, `router.put`, `router.post`, etc
+ Named URL parameters
+ Responds to `OPTIONS` requests with allowed methods
+ Multiple route middleware
+ Multiple routers
+ Nestable routers
+ `405 Method Not Allowed` support
+ `501 Not Implemented` support

## Notes

The router handles `/foo` and `/foo/` as the different urls (see why [one](https://github.com/koajs/trie-router/issues/13), [two](https://github.com/pillarjs/routington/issues/13)). If you need the same behavior for these urls just add [koa-no-trailing-slash](https://github.com/tssm/koa-no-trailing-slash) on the top of your middleware queue.

## Usage
{'fraction_non_alphanumeric': 0.1400322841000807, 'fraction_numerical': 0.009685230024213076, 'mean_word_length': 5.1361386138613865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5335068', 'n_tokens_mistral': 847, 'n_tokens_neox': 804, 'n_words': 244}