Genie.Configuration.isdev
— Function.isdev() :: Bool
Set of utility functions that return whether or not the current environment is development, production or testing.
Examples
julia> Configuration.isdev()
true
julia> Configuration.isprod()
false
Genie.Configuration.isprod
— Function.isprod() :: Bool
Set of utility functions that return whether or not the current environment is development, production or testing.
Examples
julia> Configuration.isdev()
true
julia> Configuration.isprod()
false
Genie.Configuration.istest
— Function.istest() :: Bool
Set of utility functions that return whether or not the current environment is development, production or testing.
Examples
julia> Configuration.isdev()
true
julia> Configuration.isprod()
false
Genie.Configuration.@ifdev
— Macro.@ifdev(e::Expr)
Executes expression if app is running in dev mode
Genie.Configuration.@ifprod
— Macro.@ifprod(e::Expr)
Executes expression if app is running in prod mode
Genie.Configuration.@iftest
— Macro.@iftest(e::Expr)
Executes expression if app is running in test mode
Genie.Configuration.env
— Function.env() :: String
Returns the current Genie environment.
Examples
julia> Configuration.env()
"dev"
Genie.Configuration.cache_enabled
— Function.cache_enabled() :: Bool
Indicates whether or not the app has caching enabled (cache_duration > 0
).
Genie.Configuration.Settings
— Type.mutable struct Settings
App configuration - sets up the app's defaults. Individual options are overwritten in the corresponding environment file.
Arguments
server_port::Int
: the port for running the web server (default 8000)server_host::String
: the host for running the web server (default "127.0.0.1")server_document_root::String
: path to the document root (default "public/")server_handle_static_files::Bool
: iftrue
, Genie will also serve static files. In production, it is recommended to serve static files with a web server like Nginx.server_signature::String
: Genie's signature used for tagging the HTTP responses. If empty, it will not be added.app_env::String
: the environment in which the app is running (dev, test, or prod)cors_headers::Dict{String,String}
: defaultAccess-Control-*
CORS settingscors_allowed_origins::Vector{String}
: allowed origin hosts for CORS settingscache_adapter::Symbol
: cache adapter backend (default File)cache_duraction::Int
: cache expiration time in secondslog_level::Symbol
: logging severity level, one of :debug, :info, :warn, :errorlog_formatted::Bool
: if true, Genie will attempt to pretty print some of the logged valueslog_cache::Bool
: if true, caching info is loggedlog_views::Bool
: if true, information from the view layer (template building) is loggedlog_to_file::Bool
: if true, information will be logged to file besides REPLassets_fingerprinted::Bool
: if true, asset fingerprinting is used in the asset pipelinetests_force_test_env::Bool
: if true, when running tests, Genie will automatically switch the configuration to the test environment to avoid accidental coruption of dev or prod datasession_auto_start::Bool
: if true, a session is automatically started for each requestsession_key_name::String
: the name of the session cookiesession_storage::Symbol
: the backend adapter for session storage (default File)inflector_irregulars::Vector{Tuple{String,String}}
: additional irregular singular-plural forms to be used by the Inflectorflax_compile_templates::Bool
: if true, the view templates are compiled and persisted between requestsflax_autoregister_webcomponents::Bool
: automatically register custom HTML tagsrun_as_server::Bool
: when true the server thread is launched synchronously to avoid that the script exitswebsocket_server::Bool
: if true, the websocket server is also started together with the web serverrenderer_default_layout_file::Symbol
: default name for the layout file (:app)