@paralect/hive 0.1.7 → 0.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paralect/hive",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -21,20 +21,18 @@ if (process.env.HIVE_SRC) {
21
21
  const env = process.env.APP_ENV || "development";
22
22
 
23
23
  let config = {
24
- async init() {
25
- if (process.env.HIVE_SRC) {
26
- let pluginConfigPath = `${process.env.HIVE_SRC}/app-config/app.js`;
27
-
28
- if (fs.existsSync(pluginConfigPath)) {
29
- const { default: pluginConfig } = await (import(pluginConfigPath))
30
- console.log('plugin config', pluginConfig);
31
- _.extend(config, pluginConfig);
32
-
24
+ async init() {
25
+ if (process.env.HIVE_SRC) {
26
+ let pluginConfigPath = `${process.env.HIVE_SRC}/app-config/app.js`;
27
+
28
+ if (fs.existsSync(pluginConfigPath)) {
29
+ const { default: pluginConfig } = await (import(pluginConfigPath))
30
+ _.extend(config, pluginConfig);
31
+ }
33
32
  }
34
- }
33
+ },
35
34
 
36
- },
37
- _hive: {},
35
+ _hive: {},
38
36
  env,
39
37
  port: process.env.PORT || 3001,
40
38
  domain:
@@ -59,4 +57,6 @@ _.extend(config, pluginConfig);
59
57
  throw Error(`Config [${configKey}] is missing`);
60
58
  }
61
59
  },
62
- };
60
+ };
61
+
62
+ export default config;
@@ -8,7 +8,7 @@ if (process.env.HIVE_SRC) {
8
8
 
9
9
  import Koa from "koa";
10
10
  import http from "http";
11
- import config, { init as initConfig } from "app-config";
11
+ import config from "app-config";
12
12
  import logger from "logger";
13
13
  import cors from "@koa/cors";
14
14
  import helmet from "koa-helmet";
@@ -23,7 +23,7 @@ import get from "resources/health/endpoints/get";
23
23
  import scheduler from "./scheduler";
24
24
 
25
25
  const main = async () => {
26
- await initConfig();
26
+ await config.init();
27
27
  await db.init();
28
28
 
29
29
  process.on("unhandledRejection", (reason, p) => {