I've been attempting to find an alternative to registering and hosting my Microsoft Bot with Microsoft/Azure. I'm aware that I can host the bot locally and simply register it with Microsoft to gain access to the various available channels but I'm looking to host my bot entirely separate from Microsoft's registration.
My basic goal is to expose a directline endpoint/api that can communicate with my bot without having to register said bot with Microsoft. I'm sure this could be accomplished with some sort of middleware but I'm having trouble finding resources that help. I've attempted to utilize a nodejs package, offline-directline, with no success. I believe the package is out of date and no longer works as expected. For the time being I'm using this package as a reference to attempt to concoct my own solution but any alternative resources would be helpful.
A few final details about the this project. The bot is written in .Net utilizing Microsoft's Bot Framework. I [need] a solution that works specifically with .Net bots but I'm open to one that can work with .Net [and] Nodejs bots. Thank you for any help and I'll be happy to answer any additional questions as they come up.
In relation to the offline-directline repo the following is the current state of my setup. I'm attempting to get a barebones version working by utilitizing the EchoBot sample from Microsoft. I connect to the webchat using this url http://localhost:8080/?domain=http://localhost:3000/directline. The following are the code snippets for my nodejs app and the client webchat.
app.js
const directline = require("offline-directline");
const express = require("express");
const app = express();
directline.initializeRoutes(app, 3000, "http://127.0.0.1:3978/api/messages");
index.html
<!DOCTYPE html>
<html>
<body>
<div id="webchat" role="main"></div>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<script>
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
let params = getUrlVars();
console.log(params);
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({
token: params['s'],
secret: params['t'],
domain: params['domain'],
webSocket: false
}),
},
document.getElementById('webchat')
);
</script>
</body>
</html>