Search
支持通过环境变量配置应用:
export APP_DEBUG=true export APP_PORT=3000 export APP_SECRET=your-secret-key
创建 config.json:
config.json
{ "server": { "host": "0.0.0.0", "port": 3000 }, "database": { "url": "mongodb://localhost:27017", "name": "myapp" }, "cache": { "enabled": true, "ttl": 3600 } }
config/ ├── default.json ├── development.json ├── production.json └── test.json
import { createLogger } from 'my-awesome-lib' const logger = createLogger({ level: 'debug', format: 'json', output: './logs/app.log' })