22 lines
610 B
JavaScript
22 lines
610 B
JavaScript
|
const { ServiceRegister } = require("configuration");
|
||
|
|
||
|
module.exports = {
|
||
|
devServer: (devServerConfig) => {
|
||
|
devServerConfig.open = false;
|
||
|
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;
|
||
|
},
|
||
|
};
|