Last active
December 22, 2015 02:08
-
-
Save parroty/6401386 to your computer and use it in GitHub Desktop.
Sample for Firebase access on Elixir
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
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