Skip to content

@atomic-reactor/[email protected] #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .core/boot-hooks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from 'path';
import op from 'object-path';
import _ from 'underscore';
const globby = require('./globby-patch').sync;

Expand Down
29 changes: 0 additions & 29 deletions .core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,6 @@ const registeredMiddleware = async () => {
order: Enums.priority.highest,
});

if (global.restAPI && process.env.PROXY_ACTINIUM_API !== 'off') {
ReactiumBoot.Server.Middleware.register('api', {
name: 'api',
use: proxy('/api', {
target: global.restAPI,
changeOrigin: true,
pathRewrite: {
'^/api': '',
},
logLevel: process.env.DEBUG === 'on' ? 'debug' : 'error',
ws: true,
}),
order: Enums.priority.highest,
});
}

if (global.restAPI && process.env.PROXY_ACTINIUM_API !== 'off') {
ReactiumBoot.Server.Middleware.register('api-socket-io', {
name: 'api-socket-io',
use: proxy('/actinium.io', {
target: global.restAPI.replace('/api', '') + '/actinium.io',
changeOrigin: true,
logLevel: process.env.DEBUG === 'on' ? 'debug' : 'error',
ws: true,
}),
order: Enums.priority.highest,
});
}

// parsers
ReactiumBoot.Server.Middleware.register('jsonParser', {
name: 'jsonParser',
Expand Down
23 changes: 1 addition & 22 deletions .core/server-globals.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
import path from 'path';
import op from 'object-path';
import _ from 'underscore';
import bootHooks from './boot-hooks';

const globby = require('./globby-patch').sync;
import reactiumBootHooks from './boot-hooks';

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

const reactiumBootHooks = require('./boot-hooks');

const apiConfig = async () => {
if (ReactiumBoot.API && ReactiumBoot.API.ActiniumConfig) {
const apiConfig = ReactiumBoot.API.ActiniumConfig;

global.parseAppId = apiConfig.parseAppId;
global.actiniumAppId = apiConfig.actiniumAppId;
global.restAPI = apiConfig.restAPI;
}
};

module.exports = async () => {
const ReactiumBoot = (await import('reactium-core/sdk')).default;
global.ReactiumBoot = ReactiumBoot;
global.defines = {};
global.actiniumAPIEnabled = process.env.ACTINIUM_API !== 'off';
global.actiniumProxyEnabled = process.env.PROXY_ACTINIUM_API !== 'off';

const defaultPort = 3030;
global.PORT = defaultPort;
let node_env = process.env.hasOwnProperty('NODE_ENV')
? process.env.NODE_ENV
: 'development';

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

await reactiumBootHooks();

await apiConfig();
};
23 changes: 0 additions & 23 deletions .core/server/renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,29 +196,6 @@ ReactiumBoot.Hook.registerSync(
);

ReactiumBoot.Hook.registerSync('Server.AppGlobals', (req, AppGlobals) => {
AppGlobals.register('actiniumAPIEnabled', {
name: 'actiniumAPIEnabled',
value: global.actiniumAPIEnabled,
});

if (global.actiniumAPIEnabled) {
AppGlobals.register('actiniumAppId', {
name: 'actiniumAppId',
value: global.actiniumAppId,
});

AppGlobals.register('actiniumAPIEnabled', {
name: 'actiniumAPIEnabled',
value: global.actiniumAPIEnabled,
});

AppGlobals.register('restAPI', {
name: 'restAPI',
value: global.actiniumProxyEnabled ? '/api' : global.restAPI,
serverValue: global.restAPI,
});
}

AppGlobals.register('resourceBaseUrl', {
name: 'resourceBaseUrl',
value:
Expand Down
Loading