Skip to content

Commit ef03243

Browse files
committed
Init firebase
1 parent 1a941de commit ef03243

File tree

7 files changed

+45
-2
lines changed

7 files changed

+45
-2
lines changed

serverless/.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "neat-ring-403815"
4+
}
5+
}

serverless/firebase.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"functions": [
3+
{
4+
"source": "functions",
5+
"codebase": "default",
6+
"ignore": [
7+
"venv",
8+
".git",
9+
"firebase-debug.log",
10+
"firebase-debug.*.log"
11+
]
12+
}
13+
]
14+
}

serverless/functions/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
venv

serverless/functions/main.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Welcome to Cloud Functions for Firebase for Python!
2+
# To get started, simply uncomment the below code or create your own.
3+
# Deploy with `firebase deploy`
4+
5+
from firebase_functions import https_fn
6+
from firebase_admin import initialize_app
7+
8+
# initialize_app()
9+
#
10+
#
11+
# @https_fn.on_request()
12+
# def on_request_example(req: https_fn.Request) -> https_fn.Response:
13+
# return https_fn.Response("Hello world!")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
firebase_functions~=0.1.0

serverless/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
GitPython==3.1.40
22
python-dotenv==1.0.0
3+
firebase-functions
4+
firebase-admin

serverless/run.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
import tempfile
44

55
import requests
6-
from dotenv import load_dotenv
76
from git import Repo
87

9-
load_dotenv()
8+
# The Cloud Functions for Firebase SDK to create Cloud Functions and set up triggers.
9+
from firebase_functions import firestore_fn, https_fn
10+
11+
# The Firebase Admin SDK to access Cloud Firestore.
12+
from firebase_admin import initialize_app, firestore
13+
import google.cloud.firestore
14+
15+
app = initialize_app()
16+
1017
BASE_URL = os.environ.get("BASE_URL")
1118
PASSWORD_HEADER = os.environ.get("PASSWORD_HEADER")
1219

0 commit comments

Comments
 (0)