File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,10 +48,6 @@ if (!process.env.EMAIL_FROM) {
4848
4949if ( ! process . env . NEXTAUTH_URL ) throw new Error ( "Please set NEXTAUTH_URL" ) ;
5050
51- if ( ! process . env . NEXT_PUBLIC_API_V2_URL ) {
52- console . error ( "Please set NEXT_PUBLIC_API_V2_URL" ) ;
53- }
54-
5551const getHttpsUrl = ( url ) => {
5652 if ( ! url ) return url ;
5753 if ( url . startsWith ( "http://" ) ) {
@@ -335,10 +331,6 @@ const nextConfig = {
335331 ] . filter ( Boolean ) ;
336332
337333 let afterFiles = [
338- {
339- source : "/api/v2/:path*" ,
340- destination : `${ process . env . NEXT_PUBLIC_API_V2_URL } /:path*` ,
341- } ,
342334 {
343335 source : "/org/:slug" ,
344336 destination : "/team/:slug" ,
@@ -375,6 +367,13 @@ const nextConfig = {
375367 }, */
376368 ] ;
377369
370+ if ( Boolean ( process . env . NEXT_PUBLIC_API_V2_URL ) ) {
371+ afterFiles . push ( {
372+ source : "/api/v2/:path*" ,
373+ destination : `${ process . env . NEXT_PUBLIC_API_V2_URL } /:path*` ,
374+ } ) ;
375+ }
376+
378377 return {
379378 beforeFiles,
380379 afterFiles,
You can’t perform that action at this time.
0 commit comments