From 51700bc0f3c133a19a9cc35f4698e73cdd780dbc Mon Sep 17 00:00:00 2001 From: Iqbal Date: Mon, 26 Oct 2026 09:56:37 +0700 Subject: [PATCH] Deploy to Netlify with the engine behind a same-origin /api proxy Co-Authored-By: Claude Opus 5.5 --- netlify.toml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..eb46442 --- /dev/null +++ b/netlify.toml @@ -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"