英文:
Steps to deploy botbuilder chatbot locally through webchat
问题
我想在Java中使用Microsoft Bot Builder框架构建一个机器人。我正在尝试这里提供的示例链接。我想知道如何在WebChat上本地部署使用botbuilder-java框架开发的机器人。
我已经盲目尝试了在另一个ST链接中列出的HTML,如下所示:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({
secret: '',
token: '',
domain: 'http://localhost:8080/directline',
webSocket: false // 默认为true
})
})
<!-- end snippet -->
但是在控制台上出现了各种错误。请指导我如何继续。请注意,我的机器人和WebChat客户端都需要在本地部署(不是在模拟器上)。不涉及Azure部署。
谢谢。
英文:
I want to build a bot in java using the the microsoft bot builder framework. I am trying out the samples provided here. I would like to know how can I locally deploy a bot developed using botbuilder-java framework on webchat.
I have blindly tried the html listed on another ST link as below
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({
secret: '',
token: '',
domain: 'http://localhost:8080/directline',
webSocket: false // defaults to true
})})
<!-- end snippet -->
but that that fails with various errors on console. Kindly guide me on how could I proceed. Note my bot and the web chat clients needs to be deployed locally (not on emulator). No azure deployments.
Thanks.
答案1
得分: 0
我发现 JavaScript 代码是不完整的。完整的代码如下:
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({
secret: '',
token: '',
domain: 'http://localhost:7070/directline',
webSocket: false // 默认为 true
}),
styleOptions: {
hideUploadButton: true
}
}, document.getElementById('webchat'));
英文:
I figured out that javascript code was incomplete. The complete code is
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({
secret: '',
token: '',
domain: 'http://localhost:7070/directline',
webSocket: false // defaults to true
}),
styleOptions: {
hideUploadButton: true
}
}, document.getElementById('webchat'))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论