3.1.4 • Published 8 years ago

trailpack-router v3.1.4

Weekly downloads
58
License
MIT
Repository
github
Last release
8 years ago

trailpack-router

Gitter NPM version Build status Dependency Status Code Climate Follow @trailsjs on Twitter

Trailpack Router. Aggregates all routes from config.routes to create hapi.js route objects.

Usage

Load from your trailpack config. (This pack is included by default).

// config/main.js
module.exports = {
  // ...
  packs: [
    require('trailpack-router')
  ]
}

Configure

config.routes

The list of route objects to be compiled for use by the webserver.

// config/routes.js
module.exports = [
  {
    method: [ 'GET' ],
    path: '/example/test',
    handler: 'ExampleController.test'
  }
]

During initialization, for the above example, a route object will be compiled that takes the following form:

  {
    method: [ 'GET' ],
    path: '/example/test',
    handler: 'ExampleController.test',
    config: {
      pre: [ 'ExamplePolicy.test' ]
    }
  }

Footprints and Policies

Support for Footprints and Policies is provided by trailpack-footprints.

Compatible Trailpacks

Contributing

We love contributions! Please see our Contribution Guide for more information.

License

MIT

3.1.4

8 years ago

3.1.3

8 years ago

3.1.2

8 years ago

3.1.0

8 years ago

3.1.1

8 years ago

3.0.1

8 years ago

3.0.0-pre.2

8 years ago

3.0.0-pre.1

8 years ago

2.1.1

8 years ago

2.1.0

9 years ago

2.0.0-rc1

9 years ago

2.0.0-rc2

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0-beta-4

9 years ago

1.0.0-beta-3

9 years ago

1.0.0-beta-2

9 years ago

1.0.0-beta-1

9 years ago

1.0.0-alpha-8

9 years ago

1.0.0-alpha-9

9 years ago

1.0.0-alpha-5

9 years ago

1.0.0-alpha-7

9 years ago

1.0.0-alpha-4

9 years ago

1.0.0-alpha-2

9 years ago

0.0.19

9 years ago

0.0.16

9 years ago

0.0.15

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago