Hi,
I have deployed https://analytics.growthfyi.com on Netlify (Ackee Analytics), now when I use it on https://www.growthfyi.com, it shows CORS error.
I don’t know why /api isn’t showing CORS header whereas I have already added that via netlify.toml
Here is my Netlify.toml file
[build]
publish = "dist"
command = "yarn build"
functions = "functions/"
environment = { NODE_VERSION = "14.9.0", NODE_ENV = "production" }
[[redirects]]
from = "/api"
to = "/.netlify/functions/api"
status = 200
force = true
headers = {Access-Control-Allow-Origin= "*"}
[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin= "*"
[template.environment]
ACKEE_MONGODB = "ACKEE_MONGODB"
ACKEE_USERNAME = "ACKEE_USERNAME"
ACKEE_PASSWORD = "ACKEE_PASSWORD"
ACKEE_ALLOW_ORIGIN = "ACKEE_ALLOW_ORIGIN"
I can see CORS on my landing page https://analytics.growthfyi.com and https://analytics.growthfyi.com/tracker.js but not on /api which is managed by Netlify functions.