-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
23 lines (19 loc) · 681 Bytes
/
Copy pathserver.js
File metadata and controls
23 lines (19 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import initApp from "./src/initApp.js";
import ngrok from "@ngrok/ngrok"; // 1. Import ngrok
import logger from "./src/utils/logger.js";
const port = process.env.PORT || 2000;
const app = await initApp();
app.listen(port, async () => {
logger.info(`Server Started Successfully at PORT: ${port}`);
// 2. Ngrok Tunnel Logic
try {
const session = await ngrok.connect({
addr: port,
authtoken: process.env.NGROK_AUTHTOKEN,
});
logger.info(`🌐 Public URL: ${session.url()}/handShake/webhook`);
// console.log("Ise Meta Dashboard ke 'Callback URL' mein copy-paste karo.");
} catch (err) {
logger.info(`Ngrok Error:`, { error: err });
}
});