Comments (10)
Hi!
Were you able to successfully implement this?
I am trying to make an app without firebase as well, but I can't seem to make it work.
Tim
Yes, my test code:
const express = require('express');
const bodyParser = require('body-parser');
const {dialogflow} = require('actions-on-google');
const server = express();
const assistant = dialogflow();
server.set('port', process.env.PORT || 5000);
server.use(bodyParser.json({type: 'application/json'}));
assistant.intent('helloWorld', conv => {
let name = conv.parameters.name;
conv.ask('Hello, welcome ' + name);
});
server.post('/webhook', assistant);
server.listen(server.get('port'), function () {
console.log('Express server started on port', server.get('port'));
});
from dialogflow-conversation-components-nodejs.
Hi!
Were you able to successfully implement this?
I am trying to make an app without firebase as well, but I can't seem to make it work.
TimYes, my test code:
const express = require('express'); const bodyParser = require('body-parser'); const {dialogflow} = require('actions-on-google'); const server = express(); const assistant = dialogflow(); server.set('port', process.env.PORT || 5000); server.use(bodyParser.json({type: 'application/json'})); assistant.intent('helloWorld', conv => { let name = conv.parameters.name; conv.ask('Hello, welcome ' + name); }); server.post('/webhook', assistant); server.listen(server.get('port'), function () { console.log('Express server started on port', server.get('port')); });
Thanks i have implemented this on Glitch platform works fine.
from dialogflow-conversation-components-nodejs.
Yes it is, as shown in the migration guide:
// v2
const express = require('express');
const bodyParser = require('body-parser');
const { dialogflow } = require('actions-on-google');
const app = dialogflow();
// fulfillment code here
express().use(bodyParser.json(), app).listen(3000);
from dialogflow-conversation-components-nodejs.
What if I want to listen to a post request on a specifig url such as
const assistantApp = dialogflow();
const app = express().use(bodyParser.json(), assistantApp);
app.post('/webhook', (req, res) => this.handleRequest(req, res));
app.listen(5000);
I then want to be able to handle the request myself as I am using a different chatbot sdk. Then, all I want is the raw text to pass it to my own NLU an then send the result back to Dialogflow.
Is that possible?
from dialogflow-conversation-components-nodejs.
So the app
instance in this scenario is just a regular Express Request Handler.
If you want to host multiple endpoints on a single express server, then you can do something like
const assistantApp = dialogflow();
const app = express().use(bodyParser.json());
app.post('/dialogflow', assistantApp);
// this is the same as app.post('/dialogflow', (req, res) => assistantApp(req, res));
app.post('/webhook', (req, res) => this.handleRequest(req, res));
app.listen(5000);
from dialogflow-conversation-components-nodejs.
Hi!
Were you able to successfully implement this?
I am trying to make an app without firebase as well, but I can't seem to make it work.
Tim
from dialogflow-conversation-components-nodejs.
Hi, do you know how to do it with Actions SDK? I'm trying but it doesn't work
from dialogflow-conversation-components-nodejs.
@Rebeca-azevedo The approach would be the same. I've commented on your open issue.
from dialogflow-conversation-components-nodejs.
Closing due to no direct issue with the sample itself. This is a general question and is better suited for Stack Overflow -- Github issues are for reporting bugs contained in Actions on Google samples or client libraries, thank you for understanding.
from dialogflow-conversation-components-nodejs.
i ask too
from dialogflow-conversation-components-nodejs.
Related Issues (16)
- Validation Errors HOT 5
- Where is the code for firebase when using google actions sdk HOT 1
- Replace surface capability check lines with conv.surface.capabilities.
- Error: unknown response type HOT 3
- How to Use Actions SDK without Firebase HOT 6
- Error getting documents: Error: Unknown response type: HOT 13
- Unable to retrieve parameters from previous context in code HOT 1
- Error Unknown response type Json HOT 2
- FetchError: request to an json Uri of my sap system HOT 4
- how to use without firebase? HOT 1
- Media response MP3 live streaming specifications HOT 1
- Upgrade API AI version HOT 1
- Add Device Screenshots of Components HOT 1
- Sample seems to be broken HOT 9
- Missing array braces on button assignment in card creation line 130 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dialogflow-conversation-components-nodejs.