28 lines
567 B
Text
28 lines
567 B
Text
!project SimpleApp simple_app
|
|
# should generate a SimpleApp.MixProject_ module
|
|
version: "0.1.0"
|
|
elixir: "~> 1.8"
|
|
lytl: "~> 0.1"
|
|
start_permanent: Mix.env() == prod
|
|
extra_applications: [logger]
|
|
deps: []
|
|
|
|
!module
|
|
# uses project's name as module if not module name specified
|
|
import Plug.Conn
|
|
|
|
init = opts -> IO.puts "initializing plug"; opts
|
|
|
|
call = conn _options = [] ->
|
|
IO.puts "calling plug"
|
|
conn
|
|
|> put_resp_content_type "text/plain"
|
|
|> send_resp 200 "Hello world"
|
|
|
|
long_fn =
|
|
arg1
|
|
arg2
|
|
arg3
|
|
->
|
|
|
|
# in lytx run `Plug.Adapters.Cowboy.http SimpleApp []`
|