iosignal 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vite + React</title>
8
- <script type="module" crossorigin src="/assets/index-Cy4qaVcJ.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-e2KOTYW8.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-NETrjYhz.css">
10
10
  </head>
11
11
  <body>
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "../..": {
21
- "version": "3.2.0",
21
+ "version": "3.3.0",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "boho": "^1.1.1",
@@ -1,12 +1,65 @@
1
- import { Server } from "iosignal"
2
1
 
3
- const server = new Server(
4
- {
5
- port: 7777,
6
- congPort: 8888,
7
- showMetric: 2,
8
- showMessage: 'message' // show signal message
9
- })
2
+ import { Server, api_reply } from 'iosignal'
3
+ import express from 'express';
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+
7
+ // __dirname 대체 (ESM에서는 직접 사용 불가)
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ const app = express();
12
+ let PORT = 7777;
13
+
14
+ // 정적 파일 제공
15
+ app.use(express.static(path.join(__dirname, 'public')));
16
+
17
+ app.use(
18
+ '/dist',
19
+ // 실시간 iosigal 코드 수정 테스트시.
20
+ express.static(path.join(__dirname, '../../', 'dist'))
21
+ // 설치된 패키지 사용시
22
+ // express.static(path.join(__dirname, 'node_modules', 'iosignal', 'dist'))
23
+ );
24
+
25
+ app.use('/chat/svelte',
26
+ express.static(path.join(__dirname, '../svelte-chat-js/build/'))
27
+ );
28
+ app.use('/chat/react',
29
+ express.static(path.join(__dirname, '../react-chat-js/dist/'))
30
+ );
31
+ app.use('/assets',
32
+ express.static(path.join(__dirname, '../react-chat-js/dist/assets'))
33
+ );
34
+
35
+ // 기본 라우트 (index.html 제공)
36
+ app.get('/', (req, res) => {
37
+ res.sendFile(path.join(__dirname, 'public', 'index.html'));
38
+ });
39
+
40
+ let httpServer = app.listen(PORT, () => {
41
+ if(PORT == 0 ){
42
+ PORT = httpServer.address().port
43
+ }
44
+ console.log(`🚀 서버 실행 중: http://localhost:${PORT}`);
45
+ });
46
+
47
+
48
+
49
+
50
+
51
+ // httpServer.listen(8080);
52
+
53
+
54
+ const options = {
55
+ httpServer: httpServer,
56
+ // showMetric: 2,
57
+ showMessage: 'message'
58
+ }
59
+ const ioss = new Server( options)
60
+
61
+ // api response module
62
+ ioss.api('reply', api_reply)
63
+
10
64
 
11
65
 
12
- console.log('Signaling server started. Listening on port 7777 and congPort 8888');