fennec-fe/.cracorc.js

22 lines
611 B
JavaScript
Raw Normal View History

const { ServiceRegister } = require("configuration");
module.exports = {
devServer: (devServerConfig) => {
2021-09-26 17:29:46 +08:00
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;
},
};