@live-change/server 0.5.24 → 0.6.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.
- package/index.js +2 -0
- package/lib/setupApiEndpoints.js +14 -0
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const renderTemplate = require('./lib/renderTemplate.js')
|
|
|
8
8
|
const setupApiServer = require('./lib/setupApiServer.js')
|
|
9
9
|
const setupApiSockJs = require('./lib/setupApiSockJs.js')
|
|
10
10
|
const setupApiWs = require('./lib/setupApiWs.js')
|
|
11
|
+
const setupApiEndpoints = require('./lib/setupApiEndpoints.js')
|
|
11
12
|
const setupDbServer = require('./lib/setupDbServer.js')
|
|
12
13
|
const setupDbClient = require('./lib/setupDbClient.js')
|
|
13
14
|
const setupApp = require('./lib/setupApp.js')
|
|
@@ -24,6 +25,7 @@ module.exports = {
|
|
|
24
25
|
setupApiServer,
|
|
25
26
|
setupApiSockJs,
|
|
26
27
|
setupApiWs,
|
|
28
|
+
setupApiEndpoints,
|
|
27
29
|
setupDbServer,
|
|
28
30
|
setupDbClient,
|
|
29
31
|
setupApp
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const { app } = require("@live-change/framework")
|
|
2
|
+
|
|
3
|
+
async function setupApiEndpoints(expressApp, apiServer) {
|
|
4
|
+
for(const serviceDefinition of apiServer.services.serviceDefinitions) {
|
|
5
|
+
const { name, endpoints } = serviceDefinition
|
|
6
|
+
for(const endpoint of endpoints) {
|
|
7
|
+
const path = endpoint.name ? `/api/${name}/${endpoint.name}` : `/${name}`
|
|
8
|
+
const express = await endpoint.create()
|
|
9
|
+
expressApp.use(path, express)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = setupApiEndpoints
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Live Change Framework - server",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/live-change/live-change-framework",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@live-change/dao": "0.4.
|
|
24
|
+
"@live-change/dao": "0.4.3",
|
|
25
25
|
"@live-change/dao-sockjs": "^0.2.1",
|
|
26
26
|
"@live-change/db-server": "0.5.4",
|
|
27
|
-
"@live-change/framework": "^0.
|
|
27
|
+
"@live-change/framework": "^0.6.0",
|
|
28
28
|
"@live-change/sockjs": "^0.4.0-rc.1",
|
|
29
|
-
"@live-change/uid": "0.
|
|
30
|
-
"@live-change/vue3-ssr": "0.2.
|
|
29
|
+
"@live-change/uid": "^0.6.0",
|
|
30
|
+
"@live-change/vue3-ssr": "0.2.5",
|
|
31
31
|
"dotenv": "^10.0.0",
|
|
32
32
|
"express": "^4.17.1",
|
|
33
33
|
"express-static-gzip": "2.1.1",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"websocket": "^1.0.34",
|
|
40
40
|
"yargs": "^17.3.0"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "5e4250b3a6fcf11e46f36e6b9713c2a9f4a4dc92"
|
|
43
43
|
}
|