This project asks the question of how a bot, a token server, and web chat can be built using one framework. Nest, as that framework, provides a single solution to these three requests.
A bot server is created for running a BotFramework designed bot. The bot is then exposed, as a service, via an API.
A token server is created for generating and refreshing Direct Line tokens. The token server is then exposed, as a service, via a set of APIs. Tokens are requested and consumed by Web Chat for communicating with the bot.
BotFramework-WebChat is used on the client side providing a user interface for interacting with the bot.
Pug is used for as view's rendering engine.
$ npm install
# .env file
MicrosoftAppId=<YOUR_BOTS_APP_ID>
MicrosoftAppPassword=<YOUR_BOTS_APP_PASSWORD>
DIRECT_LINE_SECRET=<DIRECT_LINE_CHANNEL_SECRET>
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
http://localhost:8080/webchat
Comming soon
- The 02.echo-bot sample is used for the bot in this project. Additional samples and features are available at BotBuilder-Samples.
- The 01.getting-started Web Chat sample is used in this project. Additional samples and features are available at BotFramework-WebChat.
client.service.ts
is presently unused but is preserved for future use. At the time of development, the intent was to use@nestjs/serve-static
to serve the web page hosting the Web Chat component. However, the "serve-static" package is not functioning correctly, so an alternative method is used inmain.ts
.- Because the file is served via
main.ts
, via the<NestExpressApplication>
interface, a rendering engine is required. Pug was chosen to fulfill the requirement.
- Because the file is served via
This project is MIT licensed.