1.0.6 • Published 11 months ago

@hawtio/backend-middleware v1.0.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

Hawtio Backend Middleware for Express

Test

An Express middleware that implements Hawtio backend.

Installation

NPM

npm install --save-dev @hawtio/backend-middleware

Yarn

yarn add --dev @hawtio/backend-middleware

Usage

You can use this backend with Express as follows:

const express = require('express')
const { hawtioBackend } = require('@hawtio/backend-middleware')

const app = express()
app.get('/', (req, res) => {
  res.send('hello!')
})
app.use(
  '/proxy',
  hawtioBackend({
    // Uncomment it if you want to see debug log for Hawtio backend
    logLevel: 'debug',
  }),
)
app.listen(3333, () => {
  console.log('started')
})

To use it with Webpack, set up dev server's middlewares as follows:

const { hawtioBackend } = require('@hawtio/backend-middleware')

module.exports = {
  devServer: {
    setupMiddlewares: middlewares => {
      middlewares.unshift({
        name: 'hawtio-backend',
        path: '/proxy',
        middleware: hawtioBackend({
          // Uncomment it if you want to see debug log for Hawtio backend
          logLevel: 'debug',
        }),
      })

      return middlewares
    },
  },
}
1.0.6

11 months ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago