Last active
February 9, 2019 22:27
-
-
Save neeraj9/45a6a0b42a6211b4744bc94d8199b67e to your computer and use it in GitHub Desktop.
BeamParticle Elixir Dynamic function for /post/ HTTP POST JSON handler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!elixir | |
# Sample Python 3 function to return what was passed in as the first argument. | |
# Notice that this template works for the /post/<thisfun> interface, where | |
# json input is passed in the first argument postBody, while the response | |
# is a binary or a string, which must be json as well. | |
fn (body, context) -> | |
decoded_map = :jiffy.decode(body, [:return_maps]) | |
# TODO process decoded_map | |
result = decoded_map | |
:jiffy.encode(result) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment