Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

firebase: fix ctor #89

Merged
merged 1 commit into from
Apr 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/FirebasePush_ESP8266/FirebasePush_ESP8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include <Firebase.h>

// create firebase client.
Firebase fbase = Firebase("example.firebaseio.com")
.auth("secret_or_token");
Firebase fbase("example.firebaseio.com", "secret_or_token");

void setup() {
Serial.begin(9600);

Expand Down
7 changes: 1 addition & 6 deletions src/Firebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,10 @@ String makeFirebaseURL(const String& path, const String& auth) {

} // namespace

Firebase::Firebase(const String& host) : host_(host) {
Firebase::Firebase(const String& host, const String& auth) : host_(host), auth_(auth) {
http_.setReuse(true);
}

Firebase& Firebase::auth(const String& auth) {
auth_ = auth;
return *this;
}

FirebaseGet Firebase::get(const String& path) {
return FirebaseGet(host_, auth_, path, &http_);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Firebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class FirebaseStream;
// Firebase REST API client.
class Firebase {
public:
Firebase(const String& host);
Firebase& auth(const String& auth);
Firebase(const String& host, const String& auth = "");

// Fetch json encoded `value` at `path`.
FirebaseGet get(const String& path);
Expand Down