Vapor v4.30.0 Release Notes
Release Date: 2020-10-01 // over 3 years ago-
🚀 ###### This patch was authored and released by @JaapWijnen.
- DotEnv files can be loaded before initializing application
- ⬇️ Reduces boilerplate code when you want to bootstrap logging with environment variables loaded from a .env file
Can be loaded in similar fashion as
Application
or provide absolute and relative .env file locations usingDotEnvFile.load(path: ...)
let env = try Environment.detect() DotEnvFile.load(for: env) LoggingSystem.bootstrap { label in// use environment variables here (before application is initialized)}let app = Application(env)