From 4234696d18f1a28d5177ec61fcf7a83b2fa8b8f9 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Sun, 18 Aug 2024 20:55:07 +0700 Subject: [PATCH] fix: cors --- README.md | 2 ++ next.config.mjs | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31d1624..996baae 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,8 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the You can get the ALBYHUB_URL, AUTH_TOKEN and ALBYHUB_NAME by logging into Alby Hub and Going to settings -> Developer. +> Optionally set `NAME`, `DESCRIPTION` and `IMAGE` if you'd like to list your Jim instance on [Jim Index](https://getalby.github.io/jim-index/) + ### Updating 1. Run `fly deploy` diff --git a/next.config.mjs b/next.config.mjs index 4678774..82957f3 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,22 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + headers: async () => { + return [ + { + source: "/api/:path*", + headers: [ + { + key: "Access-Control-Allow-Origin", + value: "*", + }, + { + key: "Access-Control-Allow-Methods", + value: "GET, POST, PUT, DELETE, OPTIONS", + }, + ], + }, + ]; + }, +}; export default nextConfig;