Skip to content

Instantly share code, notes, and snippets.

@parroty
Last active December 22, 2015 02:08
Show Gist options
  • Save parroty/6401386 to your computer and use it in GitHub Desktop.
Save parroty/6401386 to your computer and use it in GitHub Desktop.
Sample for Firebase access on Elixir
defmodule Sample do
def test do
# acquire your Firebase URL (https://xxx.firebaseio.com/)
# from the environment variable.
url = String.from_char_list!(:os.getenv("FIREBASE_URL"))
# setup url for ExFirebase module
ExFirebase.set_url(url)
# put data in /test path"
ExFirebase.put("test", ["abc", "def"])
# get data in /test path" and print
IO.inspect ExFirebase.get("test") # -> ["abc", "def"]
end
end
Sample.test
# ["abc", "def"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment