Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
  • Loading branch information
mhart committed Apr 25, 2019
1 parent c6259fb commit c91cf94
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
# Libraries don't need dependency lock
# Dependencies will be locked in application that uses them
/shard.lock

example/lib/
example/bin/
6 changes: 6 additions & 0 deletions example/shard.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 1.0
shards:
crambda:
github: lambci/crambda
version: 0.2.0

10 changes: 10 additions & 0 deletions example/shard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: example
version: 0.1.0

dependencies:
crambda:
github: lambci/crambda

targets:
bootstrap:
main: src/main.cr
9 changes: 9 additions & 0 deletions example/src/main.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "json"
require "crambda"

def handler(event : JSON::Any, context : Crambda::Context)
pp context
JSON.parse("[1, 2]")
end

Crambda.run_handler(->handler(JSON::Any, Crambda::Context))

0 comments on commit c91cf94

Please sign in to comment.