# hawtio-node-backend

> Backend services for hawtio 2.x

Latest version **2.1.3** (published 2017-01-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install hawtio-node-backend
pnpm add hawtio-node-backend
yarn add hawtio-node-backend
bun add hawtio-node-backend
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2017-01-13 |
| First published | 2015-01-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.26 |
| Dependencies | 12 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Stan Lewis |
| Maintainers | gashcrumb |
| Keywords | hawtio |

## Links

- npm: https://www.npmjs.com/package/hawtio-node-backend
- Repository: https://github.com/hawtio/hawtio-node-backend
- Homepage: https://github.com/hawtio/hawtio-node-backend#readme
- Issues: https://github.com/hawtio/hawtio-node-backend/issues
- npm.io page: https://npm.io/package/hawtio-node-backend

## Dependencies (12)

- [urijs](https://npm.io/package/urijs.md) ^1.17.0
- [lodash](https://npm.io/package/lodash.md) ^3.0.0
- [express](https://npm.io/package/express.md) ^4.11.1
- [request](https://npm.io/package/request.md) ^2.51.0
- [tiny-lr](https://npm.io/package/tiny-lr.md) ^0.1.5
- [js-logger](https://npm.io/package/js-logger.md) ^0.9.14
- [express-ws](https://npm.io/package/express-ws.md) ^0.2.6
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.11.1
- [body-parser](https://npm.io/package/body-parser.md) ^1.10.2
- [event-stream](https://npm.io/package/event-stream.md) ^3.2.1
- [underscore.string](https://npm.io/package/underscore.string.md) ^3.0.2
- [connect-livereload](https://npm.io/package/connect-livereload.md) ^0.5.2

## Recent versions

- 2.1.3 (latest) — 2017-01-13
- 2.1.2 — 2017-01-11
- 2.1.0 — 2015-09-23
- 2.0.10 — 2015-05-07
- 2.0.9 — 2015-03-09
- 2.0.8 — 2015-03-09
- 2.0.7 — 2015-02-09
- 2.0.6 — 2015-02-09
- 2.0.5 — 2015-01-29
- 2.0.4 — 2015-01-29
- 2.0.3 — 2015-01-29
- 2.0.2 — 2015-01-29
- 2.0.1 — 2015-01-29
- 2.0.0 — 2015-01-29

## README

## hawtio-node-backend

A simple node backend for hawtio 2.x that can either be run from a gulpfile or as an independent server.  The server can serve out static assets, has a dynamic proxy and also supports configuring static proxies to backend services.

### Configuration

The backend can be configured either via a config.js file:

```
// default config values
var config = {
  // server listen port
  port: 2772,
  // log level
  logLevel: logger.DEBUG,
  // path to mount the dyamic proxy
  proxy: '/proxy',
  // paths to connect to external services, an example config:
  // {
  //   proto: 'http',
  //   hostname: 'localhost',
  //   port: 8282,
  //   path: '/hawtio/jolokia',
  //   targetPath: '/hawtio/jolokia'
  // }
  //
  staticProxies: [],
  // directories to search for static assets
  staticAssets: [
    '/assets'
  ],
  liveReload: {
    enabled: false,
    port: 35729
  }
}
module.exports = config;
```

Or if using from a gulp file you can do:

```
var HawtioBackend = require('hawtio-node-backend');
HawtioBackend.setConfig({
  port: 2332,
  staticProxies: [{
    port: 8282,
    path: '/jolokia',
    targetPath: '/hawtio/jolokia'
  }],
  staticAssets: [{
    path: '/',
    dir: '.'
  }],
  liveReload: {
    enabled: true
  }
});
```

### Full live reload gulpfile set up

It's very similar to gulp-connect:

```
var HawtioBackend = require('hawtio-node-backend');

gulp.task('watch', function() {
  plugins.watch(['assets/*'], function() {
    gulp.start(['reload']);
  });
});

gulp.task('reload', function() {
  gulp.src('.')
    .pipe(HawtioBackend.reload());
});

gulp.task('server', function() {
  HawtioBackend.setConfig({
    logLevel: require('js-logger').DEBUG,
    port: 8080,
    staticProxies: [{
      port: 8282,
      path: '/hawtio/jolokia',
      targetPath: '/hawtio/jolokia'
    }],
    staticAssets: [{
      path: '/',
      dir: '.'
    }],
    liveReload: {
      enabled: true
    }
  });
  HawtioBackend.listen(function(server) {
    var host = server.address().address;
    var port = server.address().port;
    console.log("started from gulp file at ", host, ":", port);
  });
});

```

---
_Source: https://npm.io/package/hawtio-node-backend · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
