2.0.2 • Published 7 years ago

@rill/webpack-router v2.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

A tool to automatically build a middleware for Rill based on a webpack require.context. Automatically routes all files required.

Installation

npm install @rill/webpack-router

Example App

const app = require('rill')()
const router = require('@rill/webpack-router')

// Setup all of your custom middleware (automatically routed based on file system path.)
app.use(router(require.context('./controllers', true, /\.js$/)))

Example Middleware

exports.get = ({ res }) => {
  // Export the methods you wish to handle (in this case a get request).
  res.body = 'hello world'
}

exports.post = ({ res }) => {
  // Handle other methods as well.
}

Contributions

  • Use npm test to run tests.

Please feel free to create a PR!

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

7 years ago