-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update sample 21 to align with core bot #2219
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add the WebSocket code to the end of Index.js (See PR 2065 and PR 2086):
// Listen for Upgrade requests for Streaming.
server.on('upgrade', (req, socket, head) => {
// Create an adapter scoped to this WebSocket connection to allow storing session data.
const streamingAdapter = new BotFrameworkAdapter({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword
});
// Set onTurnError for the BotFrameworkAdapter created for each connection.
streamingAdapter.onTurnError = onTurnErrorHandler;
streamingAdapter.useWebSocket(req, socket, head, async (context) => {
// After connecting via WebSocket, run this logic for every request sent over
// the WebSocket connection.
await bot.run(context);
});
});
samples/javascript_nodejs/21.corebot-app-insights/bots/dialogBot.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor issue on line 65 of Index.js, the second parameter for TelemetryInitializerMiddleware
defaults to true
, so does not need to be set, and isn't set in the C# version (which is a bit of a different case due to DI, so parity may not be as important here).
@WashingtonKayaker I have removed the second param and also made the other amends you requested. Thanks for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove the local from the URL links.
samples/javascript_nodejs/21.corebot-app-insights/dialogs/flightBookingRecognizer.js
Outdated
Show resolved
Hide resolved
samples/javascript_nodejs/21.corebot-app-insights/bots/resources/welcomeCard.json
Outdated
Show resolved
Hide resolved
samples/javascript_nodejs/21.corebot-app-insights/bots/resources/welcomeCard.json
Outdated
Show resolved
Hide resolved
…htBookingRecognizer.js Co-Authored-By: WashingtonKayaker <52054121+WashingtonKayaker@users.noreply.github.com>
…es/welcomeCard.json Co-Authored-By: WashingtonKayaker <52054121+WashingtonKayaker@users.noreply.github.com>
…es/welcomeCard.json Co-Authored-By: WashingtonKayaker <52054121+WashingtonKayaker@users.noreply.github.com>
Fixes #2203