https://github.com/luillyfe/cloud-firebase
https://github.com/luillyfe/cloud-firebase
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/luillyfe/cloud-firebase
- Owner: luillyfe
- License: mit
- Created: 2023-11-05T20:57:15.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-11T22:35:48.000Z (over 2 years ago)
- Last Synced: 2025-03-15T07:22:09.856Z (over 1 year ago)
- Language: JavaScript
- Size: 70.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Import JSON
Recently I was struggling to add data from a JSON file to a firestore collection. Although, there are other approaches like using a third party service like
Firefoo or creating a firebase application. I ended up building a Firebase function since it appeared to me the more suitable solution for a single-purpose domain.
## Configuration
#### firebase.json
```json
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"]
}
],
"storage": {
"rules": "storage.rules"
}
}
```
#### .firebaserc
```json
{
"projects": {
"default": "your-project-id"
}
}
```
#### Deploy to firebase
```sh
firebase deploy --only functions
```