src/index.js
/**
 * Control hot reload differently depending on cluster mode.
 */
Control hot reload differently depending on cluster mode.
Control hot reload differently depending on cluster mode .
function reloadCallback() {
  app.use(`${reloadPath}-reset`, function (req, res) {
    process.send({ cmd: "reload-reset" });
    res.send("reload status reset...try again");
  });
  if (clusterEnabled) {
    app.use(reloadPath, async function (req, res) {
      res.send("<h1>starting cluster reload</h1>");
      process.send({ cmd: "reload" });
    });
    return;
  }
  app.use(reloadPath, async function (req, res) {
    try {
      clearRoutes();
      await startMicroLib({ hot: true });
      res.send("<h1>hot reload complete</h1>");
    } catch (error) {
      console.error(error);
    }
  });
}
function reloadCallback ( ) { app . use ( ` ${ reloadPath } ` , function ( req , res ) { process . send ( { cmd : "reload-reset" } ) ; res . send ( "reload status reset...try again" ) ; } ) ; if ( clusterEnabled ) { app . use ( reloadPath , async function ( req , res ) { res . send ( "<h1>starting cluster reload</h1>" ) ; process . send ( { cmd : "reload" } ) ; } ) ; return ; } app . use ( reloadPath , async function ( req , res ) { try { clearRoutes ( ) ; await startMicroLib ( { hot : true } ) ; res . send ( "<h1>hot reload complete</h1>" ) ; } catch ( error ) { console . error ( error ) ; } } ) ; }
Control hot reload differently depending on cluster mode.
Control hot reload differently depending on cluster mode .
// Manual reset if left in wrong stated