add python cloud function
This commit is contained in:
5
cloud-functions/python/.firebaserc
Normal file
5
cloud-functions/python/.firebaserc
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"projects": {
|
||||
"default": "hpos-af3cc"
|
||||
}
|
||||
}
|
||||
68
cloud-functions/python/.gitignore
vendored
Normal file
68
cloud-functions/python/.gitignore
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
firebase-debug.log*
|
||||
firebase-debug.*.log*
|
||||
|
||||
# Firebase cache
|
||||
.firebase/
|
||||
|
||||
# Firebase config
|
||||
|
||||
# Uncomment this if you'd like others to create their own Firebase project.
|
||||
# For a team working on the same Firebase project(s), it is recommended to leave
|
||||
# it commented so all members can deploy to the same project(s) in .firebaserc.
|
||||
# .firebaserc
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
venv
|
||||
0
cloud-functions/python/functions/.gitignore
vendored
Normal file
0
cloud-functions/python/functions/.gitignore
vendored
Normal file
17
cloud-functions/python/functions/main.py
Normal file
17
cloud-functions/python/functions/main.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Deploy with `firebase deploy`
|
||||
|
||||
from firebase_functions import https_fn
|
||||
from firebase_admin import initialize_app
|
||||
|
||||
# initialize_app()
|
||||
#
|
||||
#
|
||||
# @https_fn.on_request()
|
||||
# def on_request_example(req: https_fn.Request) -> https_fn.Response:
|
||||
# return https_fn.Response("Hello world!")
|
||||
|
||||
initialize_app()
|
||||
|
||||
@https_fn.on_request()
|
||||
def on_request_example(req: https_fn.Request) -> https_fn.Response:
|
||||
return https_fn.Response("Hello world!")
|
||||
1
cloud-functions/python/functions/requirements.txt
Normal file
1
cloud-functions/python/functions/requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
firebase_functions~=0.1.0
|
||||
Reference in New Issue
Block a user