Files
fx-serverless/examples/functions/Crystal/README.md

505 B
Vendored

Make a Crystal function a service with fx

Write a function like,

def fx(ctx)
  "hello world, crystal"
end

then deploy it with fx up command,

$ fx up -p 8000 func.cr

test it using curl

$ curl -i localhost:8000

HTTP/1.1 200 OK
Connection: keep-alive
X-Powered-By: Kemal
Content-Type: text/html
Content-Length: 20

hello world, crystal

ctx

The ctx argument is a Kemal HTTP request / response context context