@hawtio/node-backend
Backend services for hawtio v3
Last updated 7 months ago by akieling .
Apache-2.0 · Repository · Original npm · Tarball · package.json
$ cnpm install @hawtio/node-backend 
SYNC missed versions from official npm registry.

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);
  });
});

Current Tags

  • 4.1.2                                ...           latest (7 months ago)

19 Versions

  • 4.1.2                                ...           7 months ago
  • 4.1.1                                ...           8 months ago
  • 4.1.0                                ...           a year ago
  • 4.0.0                                ...           a year ago
  • 3.1.5                                ...           2 years ago
  • 3.1.4                                ...           2 years ago
  • 3.1.3                                ...           2 years ago
  • 3.1.2                                ...           2 years ago
  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.8                                ...           2 years ago
  • 3.0.7                                ...           2 years ago
  • 3.0.6                                ...           2 years ago
  • 3.0.5                                ...           2 years ago
  • 3.0.4                                ...           3 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
Downloads
Today 1
This Week 2
This Month 2
Last Day 0
Last Week 19
Last Month 22
Dependencies (13)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |