%description%
Install
firebase-tools
first.
# Link project
firebase use --add
Code in directory
functions/src/events
.
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
export default functions.https.onRequest(async (req, res) => {
const { msg = '' } = req.body
res.send({msg})
})
In directory
functions
.
# For local Web API test
npm run serve
# For local cli test
npm run shell
# Deploy to Firebase
npm run deploy