File size: 661 Bytes
5301c48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { NextRequest } from 'next/server';
import { proxyToBackend, createCORSResponse } from '../../utils/proxy';

export async function GET(req: NextRequest) {
  // const url = new URL(req.url);
  // const projectId = url.searchParams.get('id');
  
  // if (!projectId) {
  //   return new Response('Project ID is required', { status: 400 });
  // }
  
  return proxyToBackend(req, `/project/get`);
}   

// Optional: Handle OPTIONS requests for CORS if you ever call this from a different origin
// or use custom headers that trigger preflight requests. For same-origin, it's less critical.
export async function OPTIONS() {
  return createCORSResponse();
}