vovk 0.2.3-beta.53 → 0.2.3-beta.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/generateClient.js +1 -1
- package/cli/server.js +4 -2
- package/package.json +1 -1
package/cli/generateClient.js
CHANGED
|
@@ -78,7 +78,7 @@ const { default: validateOnClient = null } = ${
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
js += `
|
|
81
|
-
if(typeof navigator.sendBeacon === 'function') {
|
|
81
|
+
if(typeof navigator !== 'undefined' && typeof navigator.sendBeacon === 'function') {
|
|
82
82
|
navigator.sendBeacon(prefix + '/__ping', null);
|
|
83
83
|
}
|
|
84
84
|
`;
|
package/cli/server.js
CHANGED
|
@@ -52,8 +52,10 @@ const startPinging = (port) => {
|
|
|
52
52
|
clearInterval(pingInterval);
|
|
53
53
|
pingInterval = setInterval(() => {
|
|
54
54
|
let prefix = getVovkrc(argv.rc).prefix;
|
|
55
|
-
prefix = prefix.startsWith('http://')
|
|
56
|
-
|
|
55
|
+
prefix = prefix.startsWith('http://')
|
|
56
|
+
? prefix
|
|
57
|
+
: `http://localhost:${port}/${prefix.startsWith('/') ? prefix.slice(1) : prefix}`;
|
|
58
|
+
const endpoint = `${prefix.endsWith('/') ? prefix.slice(0, -1) : prefix}/__ping`;
|
|
57
59
|
// Create the HTTP GET request
|
|
58
60
|
const req = http.get(endpoint, () => {
|
|
59
61
|
// noop
|