corebasic 1.0.95 → 1.0.96

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/libs/features.js +5 -1
  2. package/package.json +1 -1
package/libs/features.js CHANGED
@@ -12,7 +12,7 @@ const getFeatureMethod = api => api.split(' ')[0].toLowerCase()
12
12
  const getFeatureUrl = api => api.split(' ')[1]
13
13
  const getFeature = name => features[name]
14
14
 
15
- let SLYP_FEATURES_LIST = {}
15
+ let SLYP_FEATURES_LIST = process.env.FEATURES_JSON ? JSON.parse(process.env.FEATURES_JSON) : {}
16
16
  let appId = Utils.uid()
17
17
  let SERVICE_ADDRESS = process.env.APP_ENDPOINT || 'http://127.0.0.1:3000'
18
18
 
@@ -64,6 +64,10 @@ export const start = async (app, url, file) => {
64
64
  let exp_features = {}
65
65
  for (let [key, {api}] of Object.entries(features))
66
66
  exp_features[key] = {api, service: `${SERVICE_ADDRESS}`}
67
+ if (process.env.FEATURES_JSON) {
68
+ for (let key in SLYP_FEATURES_LIST)
69
+ SLYP_FEATURES_LIST[key].headers = {JWT: SERVICE_ACCESS_TOKEN, service: true}
70
+ }
67
71
  res.json({ data: { ...SLYP_FEATURES_LIST, ...exp_features } })
68
72
  })
69
73
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.95",
4
+ "version": "1.0.96",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {