lytlang/test/fixtures/example_projects/simple_app/app.lyt

25 lines
448 B
Plaintext

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 []`