@@ -7,44 +7,55 @@ defmodule ComponentsGuideWeb.Endpoint do
7
7
signing_salt: "BfF2quM8"
8
8
]
9
9
10
- socket "/socket" , ComponentsGuideWeb.UserSocket ,
10
+ socket ( "/socket" , ComponentsGuideWeb.UserSocket ,
11
11
websocket: true ,
12
12
longpoll: false
13
+ )
13
14
14
- socket "/live" , Phoenix.LiveView.Socket , websocket: [ connect_info: [ session: @ session_options ] ]
15
+ socket ( "/live" , Phoenix.LiveView.Socket , websocket: [ connect_info: [ session: @ session_options ] ] )
15
16
16
17
# Serve at "/" the static files from "priv/static" directory.
17
18
#
18
19
# You should set gzip to true if you are running phx.digest
19
20
# when deploying your static files in production.
20
- plug Plug.Static ,
21
+ plug ( Plug.Static ,
21
22
at: "/" ,
22
23
from: :components_guide_web ,
23
24
gzip: false ,
24
25
only: ~w( css fonts images js favicon.ico robots.txt collected)
26
+ )
27
+
28
+ plug ( Plug.Static ,
29
+ at: "/collected/image" ,
30
+ from: { :components_guide_web , "priv/static/collected/image" } ,
31
+ gzip: false ,
32
+ only: ~w( svg png jpg gif)
33
+ )
25
34
26
35
# Code reloading can be explicitly enabled under the
27
36
# :code_reloader configuration of your endpoint.
28
37
if code_reloading? do
29
- socket "/phoenix/live_reload/socket" , Phoenix.LiveReloader.Socket
30
- plug Phoenix.LiveReloader
31
- plug Phoenix.CodeReloader
38
+ socket ( "/phoenix/live_reload/socket" , Phoenix.LiveReloader.Socket )
39
+ plug ( Phoenix.LiveReloader )
40
+ plug ( Phoenix.CodeReloader )
32
41
end
33
42
34
- plug Phoenix.LiveDashboard.RequestLogger ,
43
+ plug ( Phoenix.LiveDashboard.RequestLogger ,
35
44
param_key: "request_logger" ,
36
45
cookie_key: "request_logger"
46
+ )
37
47
38
- plug Plug.RequestId
39
- plug Plug.Telemetry , event_prefix: [ :phoenix , :endpoint ]
48
+ plug ( Plug.RequestId )
49
+ plug ( Plug.Telemetry , event_prefix: [ :phoenix , :endpoint ] )
40
50
41
- plug Plug.Parsers ,
51
+ plug ( Plug.Parsers ,
42
52
parsers: [ :urlencoded , :multipart , :json ] ,
43
53
pass: [ "*/*" ] ,
44
54
json_decoder: Phoenix . json_library ( )
55
+ )
45
56
46
- plug Plug.MethodOverride
47
- plug Plug.Head
48
- plug Plug.Session , @ session_options
49
- plug ComponentsGuideWeb.Router
57
+ plug ( Plug.MethodOverride )
58
+ plug ( Plug.Head )
59
+ plug ( Plug.Session , @ session_options )
60
+ plug ( ComponentsGuideWeb.Router )
50
61
end
0 commit comments