init
This commit is contained in:
27
scripts/setup-env.js
Normal file
27
scripts/setup-env.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// 環境變數設定腳本
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const envContent = `# MySQL 資料庫設定
|
||||
DB_HOST=mysql.theaken.com
|
||||
DB_PORT=33306
|
||||
DB_DATABASE=db_A022
|
||||
DB_USERNAME=A022
|
||||
DB_PASSWORD=NNyTXRWWtP4b
|
||||
|
||||
# Next.js 設定
|
||||
NEXT_PUBLIC_APP_URL=http://localhost:3006
|
||||
`
|
||||
|
||||
const envPath = path.join(__dirname, '..', '.env.local')
|
||||
|
||||
try {
|
||||
fs.writeFileSync(envPath, envContent)
|
||||
console.log('✅ .env.local 檔案已創建')
|
||||
console.log('📁 檔案位置:', envPath)
|
||||
console.log('🔐 請確認資料庫連接資訊正確')
|
||||
} catch (error) {
|
||||
console.error('❌ 創建 .env.local 檔案失敗:', error.message)
|
||||
console.log('💡 請手動創建 .env.local 檔案並添加以下內容:')
|
||||
console.log(envContent)
|
||||
}
|
Reference in New Issue
Block a user