Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
JhontSouth committed Jun 6, 2024
1 parent 215db83 commit c294295
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions samples/javascript_nodejs/85.bot-authentication-sni/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

const path = require('path');
const fs = require('fs');
// const fs = require('fs');
const { createPrivateKey } = require('crypto');
const dotenv = require('dotenv');
const restify = require('restify');
Expand Down Expand Up @@ -31,7 +31,7 @@ const { AuthBot } = require('./authBot');
server.use(restify.plugins.bodyParser());

server.listen(process.env.port || process.env.PORT || 3978, () => {
console.log(`\n${server.name} listening to ${server.url}`);
console.log(`\n${ server.name } listening to ${ server.url }`);
console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator');
console.log('\nTo talk to your bot, open the emulator select "Open Bot"');
});
Expand All @@ -41,7 +41,7 @@ const { AuthBot } = require('./authBot');
const credential = new DefaultAzureCredential();

const vaultName = process.env.KeyVaultName;
const keyVaultUrl = `https://${vaultName}.vault.azure.net`;
const keyVaultUrl = `https://${ vaultName }.vault.azure.net`;

const certificateName = process.env.CertificateName;

Expand All @@ -58,7 +58,7 @@ const { AuthBot } = require('./authBot');

// Create a private key object from the certificate
var certificateKey = createPrivateKey(cert);
//Convert the private key object to a string format
// Convert the private key object to a string format
const privateKey = certificateKey.export({
type: 'pkcs8', // Can also be 'pkcs1' depending on your format requirements
format: 'pem'
Expand All @@ -70,7 +70,7 @@ const { AuthBot } = require('./authBot');
cert,
privateKey,
process.env.MicrosoftAppTenantId
)
);

const botFrameworkAuthentication = new ConfigurationBotFrameworkAuthentication(process.env, serviceClientCredentialsFactory);

Expand All @@ -83,12 +83,12 @@ const { AuthBot } = require('./authBot');
// NOTE: In production environment, you should consider logging this to Azure
// application insights. See https://aka.ms/bottelemetry for telemetry
// configuration instructions.
console.error(`\n [onTurnError] unhandled error: ${error}`);
console.error(`\n [onTurnError] unhandled error: ${ error }`);

// Send a trace activity, which will be displayed in Bot Framework Emulator
await context.sendTraceActivity(
'OnTurnError Trace',
`${error}`,
`${ error }`,
'https://www.botframework.com/schemas/error',
'TurnError'
);
Expand Down

0 comments on commit c294295

Please sign in to comment.