const { ServiceRegister } = require("configuration"); module.exports = { devServer: (devServerConfig) => { devServerConfig.port = "auto"; devServerConfig.onListening = function (devServer) { if (!devServer) { throw new Error("webpack-dev-server is not defined"); } const port = devServer.listeningApp.address().port; const register = new ServiceRegister({ etcd: { hosts: ["http://rpi:2379"] }, }); register.register("fennec", `http://localhost:${port}/`); console.log("Listening on port:", port); }; return devServerConfig; }, };