@live-change/db-server 0.4.86 → 0.5.3

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.
Files changed (2) hide show
  1. package/lib/Server.js +5 -3
  2. package/package.json +10 -16
package/lib/Server.js CHANGED
@@ -17,6 +17,8 @@ const ReactiveDao = require("@live-change/dao")
17
17
 
18
18
  const Database = require('@live-change/db').Database
19
19
 
20
+ const debug = require('debug')('db-server')
21
+
20
22
  class DatabaseStore {
21
23
  constructor(path, backend, options) {
22
24
  this.path = path
@@ -224,7 +226,7 @@ class Server {
224
226
  const dbPath = this.config.temporary ? 'memory' : path.resolve(this.config.dbRoot, dbName+'.db')
225
227
  let dbStore = this.databaseStores.get(dbName)
226
228
  if(!dbStore) {
227
- console.log("CREATE DB", dbPath, dbConfig.storage)
229
+ debug("CREATE DB", dbPath, dbConfig.storage)
228
230
  dbStore = new DatabaseStore(dbPath, this.backend, dbConfig.storage)
229
231
  this.databaseStores.set(dbName, dbStore)
230
232
  }
@@ -268,13 +270,13 @@ class Server {
268
270
  const app = express()
269
271
  const sockJsServer = sockjs.createServer({ prefix: '/api/sockjs' })
270
272
  sockJsServer.on('connection', (conn) => {
271
- console.log("SOCKJS connection")
273
+ debug("SOCKJS connection")
272
274
  this.apiServer.handleConnection(conn)
273
275
  })
274
276
  const server = http.createServer(app)
275
277
  let wsServer = new WebSocketServer({ httpServer: server, autoAcceptConnections: false })
276
278
  wsServer.on("request",(request) => {
277
- console.log("WS URI", request.httpRequest.url, "FROM", request.remoteAddress)
279
+ debug("WS URI", request.httpRequest.url, "FROM", request.remoteAddress)
278
280
  if(request.httpRequest.url != "/api/ws") return request.reject()
279
281
  let serverConnection = new ReactiveDaoWebsocketServer(request)
280
282
  this.apiServer.handleConnection(serverConnection)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/db-server",
3
- "version": "0.4.86",
3
+ "version": "0.5.3",
4
4
  "description": "Database with observable data for live queries",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,25 +25,19 @@
25
25
  },
26
26
  "homepage": "https://github.com/live-change/db-server",
27
27
  "devDependencies": {
28
- "encoding-down": "^7.0.0",
29
- "level-rocksdb": "^4.0.0",
30
- "leveldown": "^6.0.0",
31
- "levelup": "^5.0.1",
32
- "memdown": "^6.0.0",
33
- "node-lmdb": "^0.8.0",
34
- "subleveldown": "^5.0.1",
35
28
  "tape": "^5.2.2"
36
29
  },
37
30
  "dependencies": {
38
31
  "@live-change/dao": "^0.3.12",
39
32
  "@live-change/dao-sockjs": "^0.2.1",
40
33
  "@live-change/dao-websocket": "^0.3.2",
41
- "@live-change/db": "^0.3.64",
42
- "@live-change/db-client": "^0.4.71",
43
- "@live-change/db-store-level": "^0.1.15",
44
- "@live-change/db-store-lmdb": "^0.1.22",
45
- "@live-change/db-store-observable-db": "^0.1.3",
46
- "@live-change/db-store-rbtree": "^0.1.2",
34
+ "@live-change/db": "^0.5.3",
35
+ "@live-change/db-client": "^0.5.3",
36
+ "@live-change/db-store-level": "^0.5.3",
37
+ "@live-change/db-store-lmdb": "^0.5.3",
38
+ "@live-change/db-store-observable-db": "^0.5.3",
39
+ "@live-change/db-store-rbtree": "^0.5.3",
40
+ "@live-change/sockjs": "^0.4.0-rc.1",
47
41
  "express": "^4.17.1",
48
42
  "line-reader": "^0.4.0",
49
43
  "node-interval-tree": "^1.3.3",
@@ -51,8 +45,8 @@
51
45
  "rimraf": "^3.0.2",
52
46
  "rimraf-promise": "^2.0.0",
53
47
  "segfault-handler": "^1.3.0",
54
- "@live-change/sockjs": "^0.4.0-rc.1",
55
48
  "websocket": "^1.0.34",
56
49
  "yargs": "^17.0.1"
57
- }
50
+ },
51
+ "gitHead": "d92fb65e55f55e246e7a4615cff609cafdc32eba"
58
52
  }