File size: 698 Bytes
c4412d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const express = require('express');
const app = express();
const port = 3001;

app.get('/', (req, res) => {
  res.send(`
    <!DOCTYPE html>
    <html>
      <head>
        <title>Cross-Origin Test</title>
      </head>
      <body>
        <h1>Cross-Origin Test Page</h1>
        <div id="playgo-chat-container"></div>
        <script src="http://localhost:3000/api/embed"></script>
        <script>
          playgo('init', {
            containerId: 'playgo-chat-container',
            width: '400px',
            height: '600px'
          });
        </script>
      </body>
    </html>
  `);
});

app.listen(port, () => {
  console.log(`Test server running at http://localhost:${port}`);
});