@live-change/server 0.7.37 → 0.7.39

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/Services.js CHANGED
@@ -136,6 +136,8 @@ class Services {
136
136
  }
137
137
 
138
138
  async start(startOptions) {
139
+ // when starting all services at once remove triggerRoutes for cleanup
140
+ await app.dao.request(['database', 'deleteTable'], app.databaseName, 'triggerRoutes').catch(e => 'ok')
139
141
  await Promise.all(this.plugins.map(plugin => plugin(app, this)))
140
142
  this.services = await Promise.all(this.serviceDefinitions.map(defn => {
141
143
  if(!defn.processed) {
@@ -4,9 +4,12 @@ async function setupApiEndpoints(expressApp, apiServer) {
4
4
  for(const serviceDefinition of apiServer.services.serviceDefinitions) {
5
5
  const { name, endpoints } = serviceDefinition
6
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)
7
+ let paths = endpoint.path ?? (endpoint.name ? `/api/${name}/${endpoint.name}` : `/${name}`)
8
+ if(!Array.isArray(paths)) paths = [paths]
9
+ const handler = await endpoint.create()
10
+ for(const path of paths) {
11
+ expressApp.use(path, handler)
12
+ }
10
13
  }
11
14
  }
12
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/server",
3
- "version": "0.7.37",
3
+ "version": "0.7.39",
4
4
  "description": "Live Change Framework - server",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,9 +24,9 @@
24
24
  "@live-change/dao": "0.5.22",
25
25
  "@live-change/dao-sockjs": "0.5.22",
26
26
  "@live-change/db-server": "0.6.23",
27
- "@live-change/framework": "^0.7.37",
27
+ "@live-change/framework": "^0.7.39",
28
28
  "@live-change/sockjs": "0.4.1",
29
- "@live-change/uid": "^0.7.37",
29
+ "@live-change/uid": "^0.7.39",
30
30
  "dotenv": "^16.0.3",
31
31
  "express": "^4.18.2",
32
32
  "express-static-gzip": "2.1.7",
@@ -38,5 +38,5 @@
38
38
  "websocket": "^1.0.34",
39
39
  "yargs": "^17.5.1"
40
40
  },
41
- "gitHead": "8f1f29cb2368f64e80ad491f8026be96d2d61c8e"
41
+ "gitHead": "9e9cd47f2fb1c3c82b20fdddbc5505c99e1e1c68"
42
42
  }