imwithye commited on
Commit
c3f369a
·
1 Parent(s): 220ac99
Files changed (1) hide show
  1. src/middleware.ts +2 -2
src/middleware.ts CHANGED
@@ -1,6 +1,6 @@
1
  import { NextResponse } from 'next/server';
2
 
3
- const API_HOST = process.env.NEXT_PUBLIC_API_HOST || 'http://localhost:8000';
4
 
5
  export const config = {
6
  matcher: '/api/solve',
@@ -9,7 +9,7 @@ export const config = {
9
  export function middleware(req: Request) {
10
  const url = new URL(req.url);
11
  if (url.pathname === '/api/solve') {
12
- return NextResponse.rewrite(`${API_HOST}/api/solve`);
13
  }
14
  return NextResponse.next();
15
  }
 
1
  import { NextResponse } from 'next/server';
2
 
3
+ const API_BASE_URL = process.env.API_BASE_URL || 'http://localhost:8000';
4
 
5
  export const config = {
6
  matcher: '/api/solve',
 
9
  export function middleware(req: Request) {
10
  const url = new URL(req.url);
11
  if (url.pathname === '/api/solve') {
12
+ return NextResponse.rewrite(`${API_BASE_URL}/solve`);
13
  }
14
  return NextResponse.next();
15
  }