lytlang/test/fixtures/example_projects/simple_app/app.lyt
2019-06-16 00:36:12 -05:00

24 lines
448 B
Text

mod SimpleApp
entry
:project
deps:
{:cowboy, "~> 2.6"}
{:plug, "~> 1.8"}
{:plug_cowboy, "~> 2.0"}
:app
[extra_applications: [:logger]]
import Plug.Conn
fn init default_options
IO.puts "initializing plug"
default_options
fn call conn:Plug.Conn.t() _options = []
IO.puts "calling plug"
conn
|> put_resp_content_type "text/plain"
|> send_resp 200 "Hello world"
# in lytx run `Plug.Adapters.Cowboy.http SimpleApp []`