Make connectivity check work with vitejs dev server

Head requests on directory path end up in 404
This commit is contained in:
Bastien Wirtz 2022-06-05 21:48:10 +02:00
parent cbbed6346a
commit c80854cb2d
2 changed files with 4 additions and 3 deletions

View File

@ -3,8 +3,9 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0,viewport-fit=cover">
<title>Vite App</title> <meta name="robots" content="noindex">
<title>Homer</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@ -56,7 +56,7 @@ export default {
// extra check to make sure we're not offline // extra check to make sure we're not offline
let that = this; let that = this;
const aliveCheckUrl = window.location.href + "?t=" + new Date().valueOf(); const aliveCheckUrl = `${window.location.origin}${window.location.pathname}/index.html?t=${new Date().valueOf()}`;
return fetch(aliveCheckUrl, { return fetch(aliveCheckUrl, {
method: "HEAD", method: "HEAD",
cache: "no-store", cache: "no-store",