@stonyx/rest-server 0.2.1-alpha.12 → 0.2.1-alpha.14

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.
@@ -1,12 +1,21 @@
1
- // project configuration, override-able by listed environment variables
2
- const {
3
- DEBUG,
4
- NODE_ENV,
5
- } = process.env;
6
-
7
- const environment = NODE_ENV ?? 'development';
8
-
9
- export default {
10
- environment,
11
- debug: DEBUG ?? environment === 'development',
12
- }
1
+ const {
2
+ REST_CORS_ORIGIN,
3
+ REST_CORS_METHODS,
4
+ REST_HEALTH_CHECK_DISABLE,
5
+ REST_PORT,
6
+ REST_REQUEST_PATH,
7
+ REST_TRUST_PROXY
8
+ } = process.env;
9
+
10
+ const config = {
11
+ enableHealthCheck: REST_HEALTH_CHECK_DISABLE !== 'true',
12
+ origin: REST_CORS_ORIGIN ?? '*',
13
+ methods: REST_CORS_METHODS ?? 'GET,POST,PATCH,PUT,DELETE',
14
+ dir: REST_REQUEST_PATH ?? './requests',
15
+ port: REST_PORT ?? 2666,
16
+ trustProxy: REST_TRUST_PROXY === 'true',
17
+ logColor: 'yellow',
18
+ logMethod: 'api'
19
+ };
20
+
21
+ export default config;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.2.1-alpha.12",
7
+ "version": "0.2.1-alpha.14",
8
8
  "description": "Rest Server Module for Stonyx Framework",
9
9
  "repository": {
10
10
  "type": "git",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "cors": "^2.8.5",
38
38
  "express": "^5.1.0",
39
- "stonyx": "0.2.3-beta.53"
39
+ "stonyx": "0.2.3-beta.63"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@stonyx/utils": "0.2.3-beta.23",
@@ -1,32 +0,0 @@
1
- interface RestServerEnvironmentConfig {
2
- enableHealthCheck: boolean;
3
- origin: string;
4
- methods: string;
5
- dir: string;
6
- port: string | number;
7
- trustProxy: boolean;
8
- logColor: string;
9
- logMethod: string;
10
- }
11
-
12
- const {
13
- REST_CORS_ORIGIN,
14
- REST_CORS_METHODS,
15
- REST_HEALTH_CHECK_DISABLE,
16
- REST_PORT,
17
- REST_REQUEST_PATH,
18
- REST_TRUST_PROXY
19
- } = process.env;
20
-
21
- const config: RestServerEnvironmentConfig = {
22
- enableHealthCheck: REST_HEALTH_CHECK_DISABLE !== 'true',
23
- origin: REST_CORS_ORIGIN ?? '*',
24
- methods: REST_CORS_METHODS ?? 'GET,POST,PATCH,PUT,DELETE',
25
- dir: REST_REQUEST_PATH ?? './requests',
26
- port: REST_PORT ?? 2666,
27
- trustProxy: REST_TRUST_PROXY === 'true',
28
- logColor: 'yellow',
29
- logMethod: 'api'
30
- };
31
-
32
- export default config;