Search code examples
c#botframework

Configure Custom Endpoint for Botframework Bot


I want to create a bot in C#. How can I set the path for the endpoint.

I tried to do

        httpConfiguration.MapBotFramework(botConfig =>
        {
            botConfig.UsePaths(paths => {
                paths.BasePath = "/bot";
                paths.MessagesPath = "/john";
            });

        });

But when accessing http://localhost:7990/bot/john I do get a 404.


Solution

  • Actually the code that worked for me is like below:

    httpConfiguration.MapBotFramework(botConfig =>
    {
        botConfig.BotFrameworkOptions.Paths = new BotFrameworkPaths()
        {
            BasePath = "/bot",
            MessagesPath = "/john"
        };
    });