Skip to content

Commit eb52d31

Browse files
author
Вечканов Алексей
committed
added basePath to socket path
1 parent 37edaf0 commit eb52d31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/public/javascripts/app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ Chart.defaults.global.elements.line.backgroundColor = "rgba(0,0,0,0)";
77
Chart.defaults.global.elements.line.borderColor = "rgba(0,0,0,0.9)";
88
Chart.defaults.global.elements.line.borderWidth = 2;
99

10-
var socket = io(location.protocol + '//' + location.hostname + ':' + location.port);
10+
const baseTag = document.querySelector('base');
11+
const basePath = baseTag ? baseTag.getAttribute('href') : '/';
12+
13+
var socket = io(location.protocol + '//' + location.hostname + ':' + location.port, {
14+
path: `${basePath}/socket.io`
15+
});
1116
var defaultSpan = 0;
1217
var spans = [];
1318
var statusCodesColors = ['#75D701', '#47b8e0', '#ffc952', '#E53A40'];

0 commit comments

Comments
 (0)