Skip to content

Commit 9f5f9bf

Browse files
more comment clean up
1 parent 2208be0 commit 9f5f9bf

File tree

1 file changed

+3
-6
lines changed
  • web-integrations/javascript-sdk/server-side

1 file changed

+3
-6
lines changed

web-integrations/javascript-sdk/server-side/server.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const ejs = require('ejs');
88
const express = require('express');
99
const nocache = require('nocache');
1010
const { JSDOM } = require('jsdom');
11-
const fs = require('fs');
12-
const path = require('path');
11+
const axios = require('axios');
12+
const crypto = require('crypto');
13+
const util = require('util');
1314

1415
const app = express();
1516
const port = process.env.PORT || 3034;
@@ -30,8 +31,6 @@ let uid2Sdk = null;
3031
let dom = null;
3132

3233
async function initializeSDK() {
33-
const crypto = require('crypto');
34-
3534
// Create a virtual DOM environment
3635
dom = new JSDOM('<!DOCTYPE html><html><body></body></html>', {
3736
url: 'http://localhost',
@@ -55,15 +54,13 @@ async function initializeSDK() {
5554
});
5655

5756
// Polyfill TextEncoder and TextDecoder (required by the SDK)
58-
const util = require('util');
5957
global.TextEncoder = util.TextEncoder;
6058
global.TextDecoder = util.TextDecoder;
6159
dom.window.TextEncoder = util.TextEncoder;
6260
dom.window.TextDecoder = util.TextDecoder;
6361

6462
// Load the UID2 SDK script from CDN
6563
try {
66-
const axios = require('axios');
6764
const response = await axios.get(uidJsSdkUrl);
6865

6966
// Execute the SDK code in the jsdom context

0 commit comments

Comments
 (0)