<commit_before>Hapi Named Routes
=================

Hapi plugin to add named routes to your view templates.

## Goal:
In your view templates, instead of always typing the path in your links, you can now have access to the route name variable. It will just print the path.

## How it works:

In your view template you can now access `path.name` where name is what you named the route.

To name a route you need to pass the config object to the route with the app.name being defined.

Example:
```
// Route Config
var about = {
    handler: function (request) {
        request.reply.view('about');
    },
    app : {
        name: 'about'
    }
};

// Array of routes for Hapi
routes = [
    {
        method: 'GET',
        path: '/about',
        config: about
    }
]

server.addRoutes(routes);
```
Based on the example above you now have access to `path.about` in your view templates, and will print out the routes path `/about`.

Handlebars:
`<a href="{{path.about}}">About</a>`<commit_msg>update README. correct example code<commit_after>Hapi Named Routes
=================

Hapi plugin to add named routes to your view templates.

## Goal:
In your view templates, instead of always typing the path in your links, you can now have access to the route name variable. It will just print the path.

## How it works:

In your view template you can now access `path.name` where name is what you named the route.

To name a route you need to pass the config object to the route with the app.name being defined.

Example:
```
// Route Config
var about = {
    handler: function (request, reply) {
        reply.view('about');
    },
    app : {
        name: 'about'
    }
};

// Array of routes for Hapi
routes = [
    {
        method: 'GET',
        path: '/about',
        config: about
    }
]

server.route(routes);
```
Based on the example above you now have access to `path.about` in your view templates, and will print out the routes path `/about`.

Handlebars:
`<a href="{{path.about}}">About</a>`
{'fraction_non_alphanumeric': 0.114214463840399, 'fraction_numerical': 0.0, 'mean_word_length': 3.0443548387096775, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '4951704', 'n_tokens_mistral': 579, 'n_tokens_neox': 574, 'n_words': 270}