Last active
January 10, 2016 07:06
-
-
Save santosh79/1cddd944dd06ee760848 to your computer and use it in GitHub Desktop.
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
def call(conn, _opts) do | |
:random.seed :erlang.monotonic_time() | |
rand_number = (:random.uniform * 100) |> Float.round(2) | |
{:ok, rand_json} = [rand_number: rand_number] |> JSON.encode | |
conn | |
|> put_resp_content_type("application/json") | |
|> send_resp(200, rand_json) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment