Initial commit: there's still tons of base Phoenix boilerplate to remove, but the...
[tech-radar-editor.git] / lib / tech_radar_editor / endpoint.ex
1 defmodule TechRadarEditor.Endpoint do
2 use Phoenix.Endpoint, otp_app: :tech_radar_editor
3
4 socket "/socket", TechRadarEditor.UserSocket
5
6 # Serve at "/" the static files from "priv/static" directory.
7 #
8 # You should set gzip to true if you are running phoenix.digest
9 # when deploying your static files in production.
10 plug Plug.Static,
11 at: "/", from: :tech_radar_editor, gzip: false,
12 only: ~w(css fonts images js favicon.ico robots.txt)
13
14 # Code reloading can be explicitly enabled under the
15 # :code_reloader configuration of your endpoint.
16 if code_reloading? do
17 socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
18 plug Phoenix.LiveReloader
19 plug Phoenix.CodeReloader
20 end
21
22 plug Plug.RequestId
23 plug Plug.Logger
24
25 plug Plug.Parsers,
26 parsers: [:urlencoded, :multipart, :json],
27 pass: ["*/*"],
28 json_decoder: Poison
29
30 plug Plug.MethodOverride
31 plug Plug.Head
32
33 # The session will be stored in the cookie and signed,
34 # this means its contents can be read but not tampered with.
35 # Set :encryption_salt if you would also like to encrypt it.
36 plug Plug.Session,
37 store: :cookie,
38 key: "_tech_radar_editor_key",
39 signing_salt: "w4okXyT7"
40
41 plug TechRadarEditor.Router
42 end