🔥 Firebase Hosting
This commit is contained in:
@@ -3,6 +3,10 @@ Dockerfile
|
|||||||
.github
|
.github
|
||||||
|
|
||||||
# Created by .ignore support plugin (hsz.mobi)
|
# Created by .ignore support plugin (hsz.mobi)
|
||||||
|
|
||||||
|
# Firebase
|
||||||
|
.firebase
|
||||||
|
|
||||||
### Node template
|
### Node template
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
|
|||||||
5
.firebaserc
Normal file
5
.firebaserc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"projects": {
|
||||||
|
"default": "postwoman-api"
|
||||||
|
}
|
||||||
|
}
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,4 +1,8 @@
|
|||||||
# Created by .ignore support plugin (hsz.mobi)
|
# Created by .ignore support plugin (hsz.mobi)
|
||||||
|
|
||||||
|
# Firebase
|
||||||
|
.firebase
|
||||||
|
|
||||||
### Node template
|
### Node template
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
|
|||||||
12
.travis.yml
12
.travis.yml
@@ -27,18 +27,12 @@ branches:
|
|||||||
- "master"
|
- "master"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
- "npm install firebase-tools"
|
||||||
- "npm install"
|
- "npm install"
|
||||||
- "npm run generate"
|
- "npm run generate"
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
webhooks: https://www.travisbuddy.com
|
webhooks: https://www.travisbuddy.com
|
||||||
|
|
||||||
deploy:
|
after_success:
|
||||||
provider: pages
|
- firebase deploy --token $FIREBASE_TOKEN
|
||||||
skip-cleanup: true
|
|
||||||
# Refer to: https://docs.travis-ci.com/user/deployment/pages/#Setting-the-GitHub-token
|
|
||||||
github-token: $GITHUB_ACCESS_TOKEN
|
|
||||||
target-branch: gh-pages
|
|
||||||
local-dir: dist
|
|
||||||
on:
|
|
||||||
branch: master
|
|
||||||
|
|||||||
7
database.rules.json
Normal file
7
database.rules.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
/* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */
|
||||||
|
"rules": {
|
||||||
|
".read": false,
|
||||||
|
".write": false
|
||||||
|
}
|
||||||
|
}
|
||||||
21
firebase.json
Normal file
21
firebase.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"database": {
|
||||||
|
"rules": "database.rules.json"
|
||||||
|
},
|
||||||
|
"firestore": {
|
||||||
|
"rules": "firestore.rules",
|
||||||
|
"indexes": "firestore.indexes.json"
|
||||||
|
},
|
||||||
|
"hosting": {
|
||||||
|
"public": "dist",
|
||||||
|
"cleanUrls": true,
|
||||||
|
"ignore": [
|
||||||
|
"firebase.json",
|
||||||
|
"**/.*",
|
||||||
|
"**/node_modules/**"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"storage": {
|
||||||
|
"rules": "storage.rules"
|
||||||
|
}
|
||||||
|
}
|
||||||
26
firestore.indexes.json
Normal file
26
firestore.indexes.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
// Example:
|
||||||
|
//
|
||||||
|
// "indexes": [
|
||||||
|
// {
|
||||||
|
// "collectionGroup": "widgets",
|
||||||
|
// "queryScope": "COLLECTION",
|
||||||
|
// "fields": [
|
||||||
|
// { "fieldPath": "foo", "arrayConfig": "CONTAINS" },
|
||||||
|
// { "fieldPath": "bar", "mode": "DESCENDING" }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// "fieldOverrides": [
|
||||||
|
// {
|
||||||
|
// "collectionGroup": "widgets",
|
||||||
|
// "fieldPath": "baz",
|
||||||
|
// "indexes": [
|
||||||
|
// { "order": "ASCENDING", "queryScope": "COLLECTION" }
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// ]
|
||||||
|
// ]
|
||||||
|
"indexes": [],
|
||||||
|
"fieldOverrides": []
|
||||||
|
}
|
||||||
7
firestore.rules
Normal file
7
firestore.rules
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
service cloud.firestore {
|
||||||
|
match /databases/{database}/documents {
|
||||||
|
match /{document=**} {
|
||||||
|
allow read, write;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
functions/.gitignore
vendored
Normal file
1
functions/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
||||||
8
functions/index.js
Normal file
8
functions/index.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
const functions = require('firebase-functions');
|
||||||
|
|
||||||
|
// // Create and Deploy Your First Cloud Functions
|
||||||
|
// // https://firebase.google.com/docs/functions/write-firebase-functions
|
||||||
|
//
|
||||||
|
// exports.helloWorld = functions.https.onRequest((request, response) => {
|
||||||
|
// response.send("Hello from Firebase!");
|
||||||
|
// });
|
||||||
1915
functions/package-lock.json
generated
Normal file
1915
functions/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
functions/package.json
Normal file
22
functions/package.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "functions",
|
||||||
|
"description": "Cloud Functions for Firebase",
|
||||||
|
"scripts": {
|
||||||
|
"serve": "firebase serve --only functions",
|
||||||
|
"shell": "firebase functions:shell",
|
||||||
|
"start": "npm run shell",
|
||||||
|
"deploy": "firebase deploy --only functions",
|
||||||
|
"logs": "firebase functions:log"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "8"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"firebase-admin": "^8.0.0",
|
||||||
|
"firebase-functions": "^3.1.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"firebase-functions-test": "^0.1.6"
|
||||||
|
},
|
||||||
|
"private": true
|
||||||
|
}
|
||||||
7
storage.rules
Normal file
7
storage.rules
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
service firebase.storage {
|
||||||
|
match /b/{bucket}/o {
|
||||||
|
match /{allPaths=**} {
|
||||||
|
allow read, write: if request.auth!=null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user