Created
December 30, 2020 06:10
-
-
Save Ruhshan/8368df38a13bb6e848a2247fb5954886 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Configuration | |
public class FireStoreConfig { | |
@Bean | |
public Firestore getFireStore(@Value("${firebase.credential.path}") String credentialPath) throws IOException { | |
var serviceAccount = new FileInputStream(credentialPath); | |
var credentials = GoogleCredentials.fromStream(serviceAccount); | |
var options = FirestoreOptions.newBuilder() | |
.setCredentials(credentials).build(); | |
return options.getService(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment