Deploy to Netlify with the engine behind a same-origin /api proxy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Iqbal
2026-10-26 09:56:37 +07:00
parent 42464d88b3
commit 51700bc0f3

24
netlify.toml Normal file
View File

@@ -0,0 +1,24 @@
[build]
command = "npm run build"
publish = "dist"
[build.environment]
NODE_VERSION = "22"
# Same-origin /api, as the Vite proxy does in dev: the engine needs no CORS setup.
[[redirects]]
from = "/api/*"
to = "https://learningstudio.bawana.com/api/:splat"
status = 200
force = true
# BrowserRouter: /brain, /results, ... all load index.html.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"