Remove Gateway service and configuration
- Delete Gateway module, associated Spring Boot application, and related configuration (`GatewayApplication.java`, `application.yml`, and `pom.xml`). - Remove Gateway references in `docker-compose.yml`, `.gitlab-ci.yml`, and `backend/pom.xml`. - Update backend services to directly handle requests under `/api` prefix (e.g., `/api/customers`, `/api/contact`). - Adjust frontend contact route to connect directly to the server, replacing gateway references with server URLs.
This commit is contained in:
@@ -3,10 +3,10 @@ import {NextRequest, NextResponse} from 'next/server'
|
||||
const HCAPTCHA_SECRET = process.env.HCAPTCHA_SECRET ?? ''
|
||||
const SHARED_API_KEY = process.env.SHARED_API_KEY ?? ''
|
||||
|
||||
// Detect whether to use localhost or Docker gateway
|
||||
const useLocalGatewayEnv = process.env.USE_LOCAL_GATEWAY
|
||||
const useLocalGateway = useLocalGatewayEnv?.toLowerCase() === 'true'
|
||||
const gatewayHost = useLocalGateway ? 'http://localhost:8080' : 'http://gateway:8080'
|
||||
// Detect whether to use localhost or Docker server
|
||||
const useLocalServerEnv = process.env.USE_LOCAL_SERVER
|
||||
const useLocalServer = useLocalServerEnv?.toLowerCase() === 'true'
|
||||
const serverHost = useLocalServer ? 'http://localhost:8080' : 'http://server:8080'
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
try {
|
||||
@@ -42,7 +42,7 @@ export async function POST(req: NextRequest) {
|
||||
// }
|
||||
|
||||
// Step 2: Forward to backend service
|
||||
const backendRes = await fetch(`${gatewayHost}/api/contact`, {
|
||||
const backendRes = await fetch(`${serverHost}/api/contact`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Origin: origin,
|
||||
|
||||
Reference in New Issue
Block a user