- Added NEXT_PUBLIC_RUN_MODE to .env files for environment differentiation. - Introduced .env.localhost for local development settings. - Updated .env.production with the correct API URL. - Modified package.json scripts to utilize env-cmd for environment-specific commands. - Created a common configuration module to manage environment-specific settings. - Refactored useAxios to utilize the new configuration for base URL management. - Enhanced Footer component to display current configuration values.
20 lines
519 B
TypeScript
20 lines
519 B
TypeScript
import configDevelopment from './config.development'
|
|
import configLocal from './config.local'
|
|
import configProduction from './config.production'
|
|
|
|
// 클라이언트에서는 이 함수를 사용하여 config 값을 참조합니다.
|
|
const Config = () => {
|
|
switch (process.env.NEXT_PUBLIC_RUN_MODE) {
|
|
case 'local':
|
|
return configLocal
|
|
case 'development':
|
|
return configDevelopment
|
|
case 'production':
|
|
return configProduction
|
|
default:
|
|
return configLocal
|
|
}
|
|
}
|
|
|
|
export default Config
|