MCPcopy Create free account
hub / github.com/11ty/dev-server / setupReloadNotifier

Method setupReloadNotifier

server.js:826–849  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

824
825 // Websocket Notifications
826 setupReloadNotifier() {
827 let options = {};
828 if(this.options.reloadPort) {
829 options.port = this.options.reloadPort;
830 } else {
831 // includes the port
832 options.server = this.server;
833 }
834
835 let updateServer = new WebSocketServer(options);
836
837 updateServer.on("connection", (ws) => {
838 this.sendUpdateNotification({
839 type: "eleventy.status",
840 status: "connected",
841 });
842 });
843
844 updateServer.on("error", (err) => {
845 this._serverErrorHandler(err);
846 });
847
848 this.updateServer = updateServer;
849 }
850
851 // Broadcasts to all open browser windows
852 sendUpdateNotification(obj) {

Callers 1

serverMethod · 0.95

Calls 2

_serverErrorHandlerMethod · 0.95

Tested by

no test coverage detected