add python cloud function

This commit is contained in:
Pritimay Sarkar
2023-08-21 16:02:06 +05:30
parent 3b61e4aef8
commit 960f5b9d9c
5 changed files with 91 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
{
"projects": {
"default": "hpos-af3cc"
}
}

68
cloud-functions/python/.gitignore vendored Normal file
View 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

View File

View 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!")

View File

@@ -0,0 +1 @@
firebase_functions~=0.1.0