Last active
July 14, 2025 21:04
-
-
Save WebCloud/df8b789e74b90709d5b1e454020f0260 to your computer and use it in GitHub Desktop.
Revisions
-
WebCloud revised this gist
Jul 14, 2025 . 1 changed file with 32 additions and 30 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,36 +11,38 @@ const nextConfig = { }, async rewrites() { return { beforeFiles: [ // Test rewrite - simple case { source: "/test", destination: "/api/ping", }, // OAuth routes { source: "/oauth/:path*", destination: "/api/oauth/:path*", }, // OAuth register route (special case) { source: "/register", destination: "/api/oauth/register", }, // Well-known OAuth endpoints { source: "/.well-known/oauth-authorization-server", destination: "/api/.well-known/oauth-authorization-server", }, { source: "/.well-known/oauth-authorization-server/:path*", destination: "/api/.well-known/oauth-authorization-server/:path*", }, { source: "/.well-known/oauth-protected-resource", destination: "/api/.well-known/oauth-protected-resource", }, ], }; }, }; -
WebCloud created this gist
Jul 14, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ /** @type {import('next').NextConfig} */ const nextConfig = { eslint: { ignoreDuringBuilds: true, }, typescript: { ignoreBuildErrors: true, }, images: { unoptimized: true, }, async rewrites() { return [ // Test rewrite - simple case { source: "/test", destination: "/api/ping", }, // OAuth routes { source: "/oauth/:path*", destination: "/api/oauth/:path*", }, // OAuth register route (special case) { source: "/register", destination: "/api/oauth/register", }, // Well-known OAuth endpoints { source: "/.well-known/oauth-authorization-server", destination: "/api/.well-known/oauth-authorization-server", }, { source: "/.well-known/oauth-authorization-server/:path*", destination: "/api/.well-known/oauth-authorization-server/:path*", }, { source: "/.well-known/oauth-protected-resource", destination: "/api/.well-known/oauth-protected-resource", }, ]; }, }; export default nextConfig; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ { "rewrites": [ { "source": "/api/(.*)", "destination": "/api" }, { "source": "/test", "destination": "/api/ping" }, { "source": "/oauth/(.*)", "destination": "/api/oauth/$1" }, { "source": "/register", "destination": "/api/oauth/register" }, { "source": "/.well-known/oauth-authorization-server", "destination": "/api/.well-known/oauth-authorization-server" }, { "source": "/.well-known/oauth-authorization-server/(.*)", "destination": "/api/.well-known/oauth-authorization-server/$1" }, { "source": "/.well-known/oauth-protected-resource", "destination": "/api/.well-known/oauth-protected-resource" } ] }