Skip to content

Commit a9aa510

Browse files
authored
Merge pull request #202 from Pseudo-Lab/feat/getcloser-frontend-redirect
feat(getcloser): redirect url
2 parents 91364a8 + b457dea commit a9aa510

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

getcloser/frontend/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NEXT_PUBLIC_API_BASE_URL=http://localhost:8000

getcloser/frontend/next.config.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
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

getcloser/frontend/src/app/page1/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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',

0 commit comments

Comments
 (0)