Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Type Method

detect(from:)

Detects the environment from ConfigReader. Parses the vapor.env flag.
static func detect(from config: ConfigReader) throws -> Environment

Parameters

config

ConfigReader to parse vapor.env flag from.

Return Value

The detected environment, or default env.

Configuration keys:

  • vapor.env: (string, optional, default: .development): The name of the environment to use.