Skip to content

Instantly share code, notes, and snippets.

@WebCloud
Last active July 14, 2025 21:04
Show Gist options
  • Save WebCloud/df8b789e74b90709d5b1e454020f0260 to your computer and use it in GitHub Desktop.
Save WebCloud/df8b789e74b90709d5b1e454020f0260 to your computer and use it in GitHub Desktop.
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
},
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",
},
],
};
},
};
export default nextConfig;
{
"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"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment