@live-change/server 0.1.10 → 0.1.11
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.
- package/lib/TestServer.js +7 -5
- package/package.json +1 -1
package/lib/TestServer.js
CHANGED
|
@@ -7,6 +7,7 @@ const app = require('@live-change/framework').app()
|
|
|
7
7
|
const setupApiServer = require('./setupApiServer.js')
|
|
8
8
|
const setupApiSockJs = require('./setupApiSockJs.js')
|
|
9
9
|
const setupApiWs = require('./setupApiWs.js')
|
|
10
|
+
const setupApp = require('./setupApp.js')
|
|
10
11
|
const setupDbServer = require('./setupDbServer.js')
|
|
11
12
|
const createLoopbackDao = require('./createLoopbackDao.js')
|
|
12
13
|
const SsrServer = require('./SsrServer.js')
|
|
@@ -23,9 +24,10 @@ class TestServer {
|
|
|
23
24
|
path.resolve(this.config.ssrRoot, 'dist/client/ssr-manifest.json')
|
|
24
25
|
)
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
await setupApp({
|
|
28
|
+
withDb: true,
|
|
29
|
+
dbBackend: 'mem'
|
|
30
|
+
})
|
|
29
31
|
|
|
30
32
|
await app.dao.request(['database', 'createDatabase'], app.databaseName, { }).catch(err => 'exists')
|
|
31
33
|
|
|
@@ -47,11 +49,11 @@ class TestServer {
|
|
|
47
49
|
await this.ssrServer.start()
|
|
48
50
|
|
|
49
51
|
this.expressServer = http.createServer(this.expressApp)
|
|
50
|
-
this.services = this.apiServer.services.getServicesObject()
|
|
52
|
+
this.services = this.apiServer.services.getServicesObject()
|
|
51
53
|
|
|
52
54
|
this.wsServer = await setupApiWs(this.expressServer, this.apiServer)
|
|
53
55
|
this.sockJsServer = await setupApiSockJs(this.expressServer, this.apiServer)
|
|
54
|
-
|
|
56
|
+
|
|
55
57
|
await new Promise((resolve, reject) => {
|
|
56
58
|
this.httpServer = this.expressServer.listen(this.config.port || 0, () => {
|
|
57
59
|
this.port = this.expressServer.address().port,
|