File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ NEXT_PUBLIC_API_BASE_URL = http://localhost:8000
Original file line number Diff line number Diff line change 1- import type { NextConfig } from "next" ;
2-
3- const nextConfig : NextConfig = {
1+ const nextConfig = {
2+ async rewrites ( ) {
3+ if ( process . env . NODE_ENV === 'development' ) {
4+ return [
5+ {
6+ source : '/api/:path*' ,
7+ destination : `${ process . env . NEXT_PUBLIC_BACKEND_URL || '' } /:path*` ,
8+ } ,
9+ ] ;
10+ }
11+ return [ ] ;
12+ } ,
413 /* config options here */
514} ;
615
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default function Page1() {
1717 console . log ( 'Form Submitted:' , { email } ) ;
1818
1919 try {
20- const response = await fetch ( ` ${ process . env . APP_HOST } /api/v1/users/auth` , {
20+ const response = await fetch ( ' /api/v1/users/auth' , {
2121 method : 'POST' ,
2222 headers : {
2323 'Content-Type' : 'application/json' ,
You can’t perform that action at this time.
0 commit comments