Keep in mind code reloading isīased on the file-system, therefore it is not possible to run two :code_reloader - when true, enables code reloading functionality.įor the list of code reloader configuration options see The init/2 callback on the endpoint, passing the atom :supervisorĪs the first argument and the endpoint configuration as second.Īll of Phoenix configuration, except the Compile-time configurationīelow can be set dynamically from the init/2 callback. config ( :some_config, :default_value )įor dynamically configuring the endpoint, such as loading dataįrom environment variables or configuration files, Phoenix invokes Runtime configuration, instead, is accessed during orĪfter your application is started and can be read through theĬonfig/2 function: YourAppWeb.Endpoint. The compile-timeĬonfiguration is mostly related to error handling. ![]() Compile-timeĬonfiguration means the configuration is read during compilationĪnd changing it at runtime has no effect. Endpoints can beĪdded to the supervision tree as follows: children = Īll endpoints are configured in your application environment.įor example: config :your_app, YourAppWeb.Endpoint, secret_key_base : "kjo圓o1zeidquwy1398juxzldjlksahdk3"Įndpoint configuration is split into two categories. ![]() To the supervision tree in generated applications. plug YourApp.Router endĮndpoints must be explicitly started as part of your application Part of your application: defmodule YourAppWeb.Endpoint do use Phoenix.Endpoint, otp_app : :your_app # plug. Generator, an endpoint was automatically generated as To host web specific configuration for yourĪn endpoint is simply a module defined with the help To define an initial plug pipeline for requests To provide a wrapper for starting and stopping the Overall, an endpoint has three responsibilities: It is also the interface yourĪpplication provides to the underlying web servers. The endpoint is the boundary where all requests to your Settings View Source Phoenix.Endpoint behaviour (Phoenix v1.6.14)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |