In a Phoenix application I have this:
defmodule MyAppWeb.M1 do
# [.......]
if condition == true do
plug(Plug.Static,
at: a1,
from: a2
)
plug(Plug.Static,
at: a3,
from: a4,
gzip: false
)
# [........]
end
end
defmodule MyAppWeb.Endpoint do
plug(MyAppWeb.M1)
end
Now I want to move this code into a library which I’ll use across multiple Phoenix projects. Given that there’re no functions in the module, how could it be done? By using a macro as the only one?