Bot Test Locally - microsoft-campus-community/workshop-shopping-list-bot GitHub Wiki

Prerequisite: This page assumes that you have the shopping list bot repository available on your local machine. If you do not have the bot ready to go, start here. It also assumes that you have NodeJS and Bot Framework Emulator installed.

With a bot project on your local machine, you can try it out locally with the Bot Framework Emulator. This can help you during development or testing before you are ready to deploy the bot.

Install Dependencies

When starting the bot locally for the first time or changing NPM dependency, you need to install the NPM dependencies. Open a terminal in the shopping-list-bot folder. Run npm install in the terminal. This can take a bit. Sit back and relax. ☕ or 🍵

Start the Bot

In your terminal, open in the shopping-list-bot folder, run npm start. This will start the webserver of the bot on a local port. Take note of the port number in the output. For example, http://[::]:3978 has a port number 3978.

Chat with your Bot locally

  1. Open the Bot Framework Emulator.
  2. On the Bot Framework Emulator's welcome page, click on the Open Bot button.
  3. In the 'Bot URL' text box, enter http://localhost:<PORT>/api/messages where you replace <PORT> with the port you noted down when starting the bot. Click Connect at the bottom of the dialog.
  4. This will open a chat where you can write with your bot to try it or debug it.
⚠️ **GitHub.com Fallback** ⚠️