mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-03 15:56:22 +00:00
⚡️ feat: 在前端服务中添加端口映射,并在API客户端中记录后端URL
This commit is contained in:
@ -13,6 +13,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- internal-network
|
- internal-network
|
||||||
restart: always
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- .env.frontend:/app/.env.production:ro
|
- .env.frontend:/app/.env.production:ro
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ const nextConfig: NextConfig = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
console.log('Using development API base URL:', BACKEND_URL)
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: '/api/:path*',
|
source: '/api/:path*',
|
||||||
|
@ -3,6 +3,8 @@ import { camelToSnakeObj, snakeToCamelObj } from 'field-conv'
|
|||||||
|
|
||||||
export const BACKEND_URL = process.env.BACKEND_URL || 'http://neo-blog-backend:8888'
|
export const BACKEND_URL = process.env.BACKEND_URL || 'http://neo-blog-backend:8888'
|
||||||
|
|
||||||
|
console.info(`Using backend URL: ${BACKEND_URL}`)
|
||||||
|
|
||||||
const isServer = typeof window === 'undefined'
|
const isServer = typeof window === 'undefined'
|
||||||
|
|
||||||
const API_SUFFIX = '/api/v1'
|
const API_SUFFIX = '/api/v1'
|
||||||
|
Reference in New Issue
Block a user