feat: implement CORS support and update API_URL in environment configuration

This commit is contained in:
Giuseppe Raffa
2026-04-15 23:40:08 +02:00
parent b4182c5c94
commit 370f911063
4 changed files with 28 additions and 7 deletions

View File

@@ -154,7 +154,7 @@ const HAS_DESC = { weather: true, data: false, logs: true };
// ========== API helpers ==========
async function api(method, path, body) {
const opts = { method, headers: {} };
const opts = { method, headers: {}, credentials: 'include' };
if (body) {
opts.headers['Content-Type'] = 'application/json';
opts.body = JSON.stringify(body);