【发布时间】:2017-01-07 04:46:57
【问题描述】:
我有一点问题...我正在尝试在我自己的带有 IIS 的主机上的新 Microsoft Bot Framework 上运行 Skype Bot。因为它是用 Node.js 编写的,所以我使用 iisnode 来托管它。节点正在处理它,但是当我测试时出现此错误:
MethodNotAllowed
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
<title>405 - P��kaz HTTP pou�it� k p��stupu na tuto str�nku nen� povolen.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Chyba serveru</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>405 � P��kaz HTTP pou�it� k p��stupu na tuto str�nku nen� povolen.</h2>
<h3>Hledanou str�nku nelze zobrazit, proto�e do�lo k pokusu o p��stup pomoc� neplatn� metody (p��kazu HTTP).</h3>
</fieldset></div>
</div>
</body>
</html>
(这是捷克语,抱歉)
这是 app.js(主脚本):
// Add your requirements
var restify = require('restify');
var builder = require('botbuilder');
// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.PORT || 3000, function()
{
console.log('%s poslouchá na %s', server.name, server.url);
});
// Create chat bot
var connector = new builder.ChatConnector
({ appId: 'CENSORED', appPassword: 'CENSORED' });
var bot = new builder.UniversalBot(connector);
server.post('/api/messages', connector.listen());
// Create bot dialogs
bot.dialog('/', function (session) {
session.send("Hello World!");
});
这只是我在这里找到的示例 (https://blogs.msdn.microsoft.com/sarahsays/2016/06/01/microsoft-bot-framework-part-1/) 我使用 Microsoft Bot Framework Channel Emulator 使其在本地工作,所以代码是正确的。
我不想为此购买 Azure...
感谢您的回复:)
【问题讨论】:
标签: node.js bots botframework