Not an expert, so just sharing my observations here.
Using debug output streams in MS Teams chatbot's server.listen() method stops web browser from opening to either install the app in local environment or to launch the app in testtool.
3. Replace `console.log` part(s) within `server.listen()` method with just `log`. It will look something like this:
```typescript
const server = restify.createServer();
const port = process.env.port || process.env.PORT || 3978;
server.use(restify.plugins.bodyParser());
server.listen(port, () => {
//console.log(`listening on ${port} 🚀`);
//console.log(`\nBot Started, ${server.name} listening to ${server.url}`);
log(`listening on ${port} 🚀`);
log(`\nBot Started, ${server.name} listening to ${server.url}`);
});
Install debug with npm install debug, if necessary.
Terminal window will show the following - stopping right before the logging function:
[nodemon] starting `node --inspect=9239 -r ts-node/register ./src/index.ts`
Debugger listening on ws://127.0.0.1:9239/e4e12f8c-bcb1-4612-bc00-603f7ea0cxxx
For help, see: https://nodejs.org/en/docs/inspector
(node:29632) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Language
Javascript/Typescript
Version
1.3.1
Description
Not an expert, so just sharing my observations here.
Using
debug
output streams in MS Teams chatbot'sserver.listen()
method stops web browser from opening to either install the app in local environment or to launch the app in testtool.There's only one example of this logic within Teams AI samples here: https://github.com/microsoft/teams-ai/blob/3ec61e6e6fa267a7cb994aa35f13f2b93da9912e/js/samples/04.ai-apps/h.datasource-azureOpenAI/src/index.ts
Reproduction Steps
index.ts
file:const log = debug('azureopenai:server'); log.log = console.log.bind(console);
debug
dependencies to thepackage.json
file:debug
withnpm install debug
, if necessary.