🔧 Redirect node endpoints to cloud functions, for Netlify

This commit is contained in:
Alicia Sykes 2021-09-19 13:36:12 +01:00
parent c2f99d6d7f
commit 96d4deefa1
1 changed files with 15 additions and 14 deletions

View File

@ -7,29 +7,30 @@
base = "/"
command = "yarn build"
publish = "dist"
functions = "./services/serverless-functions"
functions = "services/serverless-functions"
# Site info, used for the 1-Click deploy page
[template.environment]
STATUSKIT_PAGE_TITLE = "Dashy"
STATUSKIT_COMPANY_LOGO = "https://raw.githubusercontent.com/Lissy93/dashy/master/docs/assets/logo.png"
STATUSKIT_SUPPORT_CONTACT_LINK = "https://dashy.to"
STATUSKIT_RESOURCES_LINK = "https://github.com/Lissy93/dashy/tree/master/docs"
STATUSKIT_SUPPORT_CONTACT_LINK = "https://github.com/lissy93/dashy"
STATUSKIT_RESOURCES_LINK = "https://dashy.to/docs"
# Specify handlers to redirect to serverless functions instead of Node API endpoints
[[edge_handlers]]
path = "/status-check"
handler = "cloud-status-check"
[[edge_handlers]]
path = "/config-manager/save"
handler = "not-supported"
[[edge_handlers]]
path = "/config-manager/rebuild"
handler = "not-supported"
# Redirect the Node endpoints to serverless functions
[[redirects]]
from = "/status-check"
to = "/.netlify/functions/cloud-status-check"
status = 301
force = true
[[redirects]]
from = "/config-manager/*"
to = "/.netlify/functions/not-supported"
status = 301
force = true
# Set any security headers here
[[headers]]
for = "/*"
[headers.values]
# Uncomment to enable Netlify user control. You must have a paid plan.
# Basic-Auth = "someuser:somepassword anotheruser:anotherpassword"
# Basic-Auth = "someuser:somepassword anotheruser:anotherpassword"