this repo has no description
1defmodule EslHnWeb do
2 @moduledoc """
3 The entrypoint for defining your web interface, such
4 as controllers, components, channels, and so on.
5
6 This can be used in your application as:
7
8 use EslHnWeb, :controller
9 use EslHnWeb, :html
10
11 The definitions below will be executed for every controller,
12 component, etc, so keep them short and clean, focused
13 on imports, uses and aliases.
14
15 Do NOT define functions inside the quoted expressions
16 below. Instead, define additional modules and import
17 those modules here.
18 """
19
20 def static_paths, do: ~w(assets fonts images favicon.ico robots.txt)
21
22 def router do
23 quote do
24 use Phoenix.Router, helpers: false
25
26 # Import common connection and controller functions to use in pipelines
27 import Plug.Conn
28 import Phoenix.Controller
29 end
30 end
31
32 def channel do
33 quote do
34 use Phoenix.Channel
35 end
36 end
37
38 def controller do
39 quote do
40 use Phoenix.Controller,
41 formats: [:json],
42 layouts: []
43
44 import Plug.Conn
45
46 unquote(verified_routes())
47 end
48 end
49
50 def verified_routes do
51 quote do
52 use Phoenix.VerifiedRoutes,
53 endpoint: EslHnWeb.Endpoint,
54 router: EslHnWeb.Router,
55 statics: EslHnWeb.static_paths()
56 end
57 end
58
59 @doc """
60 When used, dispatch to the appropriate controller/live_view/etc.
61 """
62 defmacro __using__(which) when is_atom(which) do
63 apply(__MODULE__, which, [])
64 end
65end