3.1.4 • Published 6 years ago

trailpack-router v3.1.4

Weekly downloads
58
License
MIT
Repository
github
Last release
6 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

6 years ago

3.1.3

6 years ago

3.1.2

7 years ago

3.1.0

7 years ago

3.1.1

7 years ago

3.0.1

7 years ago

3.0.0-pre.2

7 years ago

3.0.0-pre.1

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.0-rc1

7 years ago

2.0.0-rc2

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0-beta-4

8 years ago

1.0.0-beta-3

8 years ago

1.0.0-beta-2

8 years ago

1.0.0-beta-1

8 years ago

1.0.0-alpha-8

8 years ago

1.0.0-alpha-9

8 years ago

1.0.0-alpha-5

8 years ago

1.0.0-alpha-7

8 years ago

1.0.0-alpha-4

8 years ago

1.0.0-alpha-2

8 years ago

0.0.19

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago