Skip to content

Commit

Permalink
🔧 Move catch-all redirect after serverless funcs
Browse files Browse the repository at this point in the history
The catch-all redirect is required for Vue's HTML5 history mode to work on Netlify. However the current configuration was redirecting everything, including the API endpoints to index.html, preventing the serverless functions (for status checking, config management, etc) from working. 🤞 Hopefully this will work...
  • Loading branch information
Lissy93 authored Nov 7, 2021
1 parent c0214ca commit c5dea1e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
STATUSKIT_SUPPORT_CONTACT_LINK = "https://github.com/lissy93/dashy"
STATUSKIT_RESOURCES_LINK = "https://dashy.to/docs"

# For router history mode, ensure pages land on index
[[redirects]]
from = "/*"
to = "/index.html"
status = 200

# Redirect the Node endpoints to serverless functions
[[redirects]]
from = "/status-check"
Expand All @@ -33,6 +27,12 @@
to = "/.netlify/functions/not-supported"
status = 301
force = true

# For router history mode, ensure pages land on index
[[redirects]]
from = "/*"
to = "/index.html"
status = 200

# Set any security headers here
[[headers]]
Expand Down

0 comments on commit c5dea1e

Please sign in to comment.