Created
June 28, 2021 23:23
-
-
Save drewrothstein/7babd3470b41d84320a42a530ea973e0 to your computer and use it in GitHub Desktop.
Function Webhook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
conversation, | |
} = require('@assistant/conversation'); | |
const functions = require('firebase-functions'); | |
const fetch = require('node-fetch'); | |
const app = conversation({debug: true}); | |
const URL = 'https://<YOUR FUNCTION URL>.cloudfunctions.net/automower'; | |
app.handle('default', async conv => { | |
const apiResponse = await fetch(URL); | |
const text = await apiResponse.text(); | |
conv.add(text); | |
}); | |
exports.ActionsOnGoogleFulfillment = functions.https.onRequest(app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment