Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refetching data not working #68

Open
Techs4gnu opened this issue Dec 3, 2023 · 2 comments
Open

Refetching data not working #68

Techs4gnu opened this issue Dec 3, 2023 · 2 comments

Comments

@Techs4gnu
Copy link

Deployed the web check on https://webcheck.mydevelopmentpro.com. But the results generated are not available when trying to refresh the page.

What could be the issue?

@Lissy93
Copy link
Owner

Lissy93 commented Dec 30, 2023

Hey @Techs4gnu

Because it's a SPA. So to fix your issue, you basically just need to tell your web server to handle 404 errors by responding with a 200 and serving up index.html. (Don't worry, all 404 and client error will be handled by web-check already)

@Lissy93
Copy link
Owner

Lissy93 commented Dec 30, 2023

If you could let me know what web server your using, and I can help you update your config file.
But here's how I've gotten similar things working with various web servers and static hosting providers....

Netlify

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200  

Vercel

{
    "rewrites": [
        { "source": "/(.*)", "destination": "/index.html" }
    ]
}

Caddy

location / {
    try_files $uri /index.html;
}

Lighttpd

url.rewrite-if-not-file = ("(.*)" => "/index.html")

Traefik

http:
  middlewares:
    spa-rewrite:
      replacePathRegex:
        regex: "^/.+"
        replacement: "/index.html"

Apache

FallbackResource /index.html

.httaccess

(it's been a while since I've written one of these, so double-check it before running!)

RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]

LightSpeed

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.html [L]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants