Skip to content

Commit a0ab363

Browse files
committed
@atomic-reactor/[email protected]
1 parent 473b740 commit a0ab363

File tree

6 files changed

+8301
-13627
lines changed

6 files changed

+8301
-13627
lines changed

.core/boot-hooks.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import path from 'path';
2-
import op from 'object-path';
32
import _ from 'underscore';
43
const globby = require('./globby-patch').sync;
54

.core/index.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,6 @@ const registeredMiddleware = async () => {
4141
order: Enums.priority.highest,
4242
});
4343

44-
if (global.restAPI && process.env.PROXY_ACTINIUM_API !== 'off') {
45-
ReactiumBoot.Server.Middleware.register('api', {
46-
name: 'api',
47-
use: proxy('/api', {
48-
target: global.restAPI,
49-
changeOrigin: true,
50-
pathRewrite: {
51-
'^/api': '',
52-
},
53-
logLevel: process.env.DEBUG === 'on' ? 'debug' : 'error',
54-
ws: true,
55-
}),
56-
order: Enums.priority.highest,
57-
});
58-
}
59-
60-
if (global.restAPI && process.env.PROXY_ACTINIUM_API !== 'off') {
61-
ReactiumBoot.Server.Middleware.register('api-socket-io', {
62-
name: 'api-socket-io',
63-
use: proxy('/actinium.io', {
64-
target: global.restAPI.replace('/api', '') + '/actinium.io',
65-
changeOrigin: true,
66-
logLevel: process.env.DEBUG === 'on' ? 'debug' : 'error',
67-
ws: true,
68-
}),
69-
order: Enums.priority.highest,
70-
});
71-
}
72-
7344
// parsers
7445
ReactiumBoot.Server.Middleware.register('jsonParser', {
7546
name: 'jsonParser',

.core/server-globals.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,17 @@
11
import path from 'path';
22
import op from 'object-path';
33
import _ from 'underscore';
4-
import bootHooks from './boot-hooks';
5-
6-
const globby = require('./globby-patch').sync;
4+
import reactiumBootHooks from './boot-hooks';
75

86
global.rootPath = path.resolve(__dirname, '..');
97

10-
const reactiumBootHooks = require('./boot-hooks');
11-
12-
const apiConfig = async () => {
13-
if (ReactiumBoot.API && ReactiumBoot.API.ActiniumConfig) {
14-
const apiConfig = ReactiumBoot.API.ActiniumConfig;
15-
16-
global.parseAppId = apiConfig.parseAppId;
17-
global.actiniumAppId = apiConfig.actiniumAppId;
18-
global.restAPI = apiConfig.restAPI;
19-
}
20-
};
21-
228
module.exports = async () => {
239
const ReactiumBoot = (await import('reactium-core/sdk')).default;
2410
global.ReactiumBoot = ReactiumBoot;
2511
global.defines = {};
26-
global.actiniumAPIEnabled = process.env.ACTINIUM_API !== 'off';
27-
global.actiniumProxyEnabled = process.env.PROXY_ACTINIUM_API !== 'off';
2812

2913
const defaultPort = 3030;
3014
global.PORT = defaultPort;
31-
let node_env = process.env.hasOwnProperty('NODE_ENV')
32-
? process.env.NODE_ENV
33-
: 'development';
3415

3516
if (process.env.NODE_ENV === 'development') {
3617
let gulpConfig;
@@ -54,6 +35,4 @@ module.exports = async () => {
5435
require('./reactium.log');
5536

5637
await reactiumBootHooks();
57-
58-
await apiConfig();
5938
};

.core/server/renderer/index.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -196,29 +196,6 @@ ReactiumBoot.Hook.registerSync(
196196
);
197197

198198
ReactiumBoot.Hook.registerSync('Server.AppGlobals', (req, AppGlobals) => {
199-
AppGlobals.register('actiniumAPIEnabled', {
200-
name: 'actiniumAPIEnabled',
201-
value: global.actiniumAPIEnabled,
202-
});
203-
204-
if (global.actiniumAPIEnabled) {
205-
AppGlobals.register('actiniumAppId', {
206-
name: 'actiniumAppId',
207-
value: global.actiniumAppId,
208-
});
209-
210-
AppGlobals.register('actiniumAPIEnabled', {
211-
name: 'actiniumAPIEnabled',
212-
value: global.actiniumAPIEnabled,
213-
});
214-
215-
AppGlobals.register('restAPI', {
216-
name: 'restAPI',
217-
value: global.actiniumProxyEnabled ? '/api' : global.restAPI,
218-
serverValue: global.restAPI,
219-
});
220-
}
221-
222199
AppGlobals.register('resourceBaseUrl', {
223200
name: 'resourceBaseUrl',
224201
value:

0 commit comments

Comments
 (0)