🔧 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

View File

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