簡體   English   中英

Skype Bot框架-Node.js

[英]Skype Bot Framework - Node.js

我沒什么問題...我正在嘗試使用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 ...

感謝您的回復:)

這篇文章很老,但是您很可能遇到了CORS問題-您如何測試? 似乎不允許使用OPTIONS方法(CORS預檢的一部分)。 您必須在IIS中啟用CORS以及最有可能的配置設置,以允許使用除標准GET / PUT之外的HTTP方法。 (也想到了HEAD)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM