Skip to content

Commit

Permalink
Debug URL in initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
cappp authored Apr 7, 2020
1 parent 14da2e4 commit f508180
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/controllers/initializer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as ora from 'ora';
import { readFileSync } from 'fs';
import { Whatsapp } from '../api/whatsapp';
import { CreateConfig } from '../config/create-config';
import { isAuthenticated, isInsideChat, retrieveQR } from './auth';
Expand Down Expand Up @@ -38,6 +39,9 @@ export async function create(
spinner.start('Injecting api');
waPage = await injectApi(waPage);
spinner.succeed('Whatsapp is ready');

const debugURL = `http://localhost:${readFileSync('./session/DevToolsActivePort').slice(0, -54)}`;
console.log(`\nDebug ➜ \x1b[34m${debugURL}\x1b[0m`);

return new Whatsapp(waPage);
}

0 comments on commit f508180

Please sign in to comment.