clearpass-node-extension-sdk

2.4.8 • Public • Published

node-extension-sdk

Sample Express Configuration

LABEL \
    com.hpe.aruba.clearpass.extension.http.8080="" \
    com.hpe.aruba.clearpass.extension.http.8080.description="Extension Statistics" \
if (config.enableStats) {
    const statsApp = express();
    const statsPort = process.env.STATS_PORT || 8080;
    const statsMiddleware = ext.statsMiddleware();

    // Add the middleware to both express servers. Otherwise API tracking will not work.
    app.use(statsMiddleware);
    statsApp.use(statsMiddleware);

    statsApp.set('port', statsPort);

    log.info('Starting stats web services...');

    statsApp.get('/', function (req, res, next) {
        res.redirect('stats');
    });

    const statsServer = statsApp.listen(statsApp.get('port'), () => {
        log.info(`Stats server listening on port ${statsServer.address().port}.`);
    });
}

Readme

Keywords

none

Package Sidebar

Install

npm i clearpass-node-extension-sdk

Weekly Downloads

8

Version

2.4.8

License

none

Unpacked Size

626 kB

Total Files

8

Last publish

Collaborators

  • santsys
  • shrkbait-hpe