Skip to content

Commit ad913b7

Browse files
committed
fix: crud.socket connection refactored
1 parent 974306d commit ad913b7

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"dependencies": {
2929
"@cocreate/crud-client": "^1.10.0",
3030
"@cocreate/hosting": "^1.3.4",
31-
"@cocreate/socket-client": "^1.5.6",
3231
"extract-comments": "^1.1.0",
3332
"glob": "^7.1.6",
3433
"parse-html-comments": "^1.3.1"

src/index.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const CoCreateCrud = require('@cocreate/crud-client')
2-
const CoCreateSocket = require('@cocreate/socket-client')
32
const mime = require('mime-types')
43

54
const fs = require('fs');
@@ -25,17 +24,15 @@ console.log(config)
2524
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0
2625

2726
/** init cocreatecrud and socket **/
28-
let socket = new CoCreateSocket("ws");
29-
CoCreateCrud.setSocket(socket);
30-
socket.create({
31-
namespace: socketConfig.organization_id,
32-
room: null,
27+
CoCreateCrud.socket.create({
28+
organization_id: socketConfig.organization_id,
29+
apiKey: socketConfig.apiKey,
3330
host: socketConfig.host
3431
})
3532

3633
const commonParam = {
37-
apiKey : socketConfig.apiKey,
38-
organization_id : socketConfig.organization_id,
34+
apiKey: socketConfig.apiKey,
35+
organization_id: socketConfig.organization_id,
3936
broadcast: false
4037
}
4138

0 commit comments

Comments
 (0)