I want to create a bot in C#. How can I set the path for the endpoint.
I tried to do
httpConfiguration.MapBotFramework(botConfig =>
{
Actually the code that worked for me is like below:
httpConfiguration.MapBotFramework(botConfig =>
{
botConfig.BotFrameworkOptions.Paths = new BotFrameworkPaths()
{
BasePath = "/bot",
MessagesPath = "/john"
};
});
The endpoint will be hardcoded if you use the provided integration layer, you can change this by not using our integration layer. There is an example of this in this project
Edit
Interesting as I had not thought of it from that perspective. I like the other way because it gives you more open control of your endpoint and allows for multiple endpoints easily, but this would work as well. I was able to successfully change the endpoint of the bot by making a few changes to it.
first I set up my .bot file like this replacing the old path with something different in the 'endpoint' property:
{
"name": "{your botname}",
"padlock": "{your-padlock}",
"services": [
{
"type": "endpoint",
"name": "development", // "production" would work too
"endpoint": "https://{your-site}.azurewebsites.net/bot/endpoint",
"appId": "{your-app-id}",
"appPassword": "{your-app-password}",
"id": "1"
}
],
"version": "2.0"
}
then all I had to do was add this into my startup:
options.Paths.BasePath = "/bot";
options.Paths.MessagesPath = "/endpoint";