pnxtech / hydra-express

A module which wraps Hydra and ExpressJS into a library for building distributed applications - such as microservices
MIT License
184 stars 38 forks source link

callback of hydraExpress.init is called 2 times #29

Closed k33g closed 7 years ago

k33g commented 7 years ago

Hello,

I'm trying this sample, and the callback seems to be called 2 times (it displays 2 😀)

const hydraExpress = require('fwsp-hydra-express');
const config = require('./config.json');

hydraExpress.init(config, () => {
  console.log("😀")
  const express = hydraExpress.getExpress();
  const api = express.Router();

  api.get('/', function(req, res) {
    res.send({
      msg: `hello from ${hydra.getServiceName()} - ${hydra.getInstanceID()}`
    });
  });

  hydraExpress.registerRoutes({
    '': api
  });
});
cjus commented 7 years ago

@k33g thanks for the bug report. This should be fixed in fwsp-hydra-express@0.14.5

k33g commented 7 years ago

@cjus thx, it works fine 👍