rebuilt without console logs
This commit is contained in:
parent
fdd1e79a2c
commit
f41ac47c3e
11 changed files with 40 additions and 32 deletions
|
@ -3,7 +3,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", {
|
Object.defineProperty(exports, "__esModule", {
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
exports.default = void 0;
|
exports.default = _default;
|
||||||
|
|
||||||
var actions = _interopRequireWildcard(require("../constants/publish_action_types"));
|
var actions = _interopRequireWildcard(require("../constants/publish_action_types"));
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ var initialState = {
|
||||||
thumbnailChannelId: thumbnailChannelId
|
thumbnailChannelId: thumbnailChannelId
|
||||||
};
|
};
|
||||||
|
|
||||||
var _default = function _default() {
|
function _default() {
|
||||||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
||||||
var action = arguments.length > 1 ? arguments[1] : undefined;
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
@ -118,6 +118,6 @@ var _default = function _default() {
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.default = _default;
|
;
|
|
@ -3,7 +3,7 @@
|
||||||
Object.defineProperty(exports, "__esModule", {
|
Object.defineProperty(exports, "__esModule", {
|
||||||
value: true
|
value: true
|
||||||
});
|
});
|
||||||
exports.default = void 0;
|
exports.default = _default;
|
||||||
|
|
||||||
var _siteConfig = _interopRequireDefault(require("@config/siteConfig.json"));
|
var _siteConfig = _interopRequireDefault(require("@config/siteConfig.json"));
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ if (_siteConfig.default) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var _default = function _default() {
|
function _default() {
|
||||||
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
||||||
var action = arguments.length > 1 ? arguments[1] : undefined;
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
||||||
|
|
||||||
|
@ -48,6 +48,6 @@ var _default = function _default() {
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.default = _default;
|
;
|
|
@ -46,7 +46,7 @@ const initialState = {
|
||||||
thumbnailChannelId,
|
thumbnailChannelId,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default (state = initialState, action) => {
|
export default function (state = initialState, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case actions.FILE_SELECTED:
|
case actions.FILE_SELECTED:
|
||||||
return Object.assign({}, initialState, { // note: clears to initial state
|
return Object.assign({}, initialState, { // note: clears to initial state
|
||||||
|
|
|
@ -38,7 +38,7 @@ if (siteConfig) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (state = initialState, action) => {
|
export default function (state = initialState, action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
|
27
index.js
27
index.js
|
@ -1,10 +1,17 @@
|
||||||
// set up aliasing
|
// set up module aliasing
|
||||||
const moduleAlias = require('module-alias');
|
const moduleAlias = require('module-alias');
|
||||||
const createModuleAliases = require('./server/utils/createModuleAliases.js');
|
const createModuleAliases = require('./server/utils/createModuleAliases.js');
|
||||||
const customAliases = createModuleAliases();
|
const customAliases = createModuleAliases();
|
||||||
console.log('custom aliases', customAliases);
|
|
||||||
moduleAlias.addAliases(customAliases);
|
moduleAlias.addAliases(customAliases);
|
||||||
|
|
||||||
|
// test configs
|
||||||
|
const checkForConfig = require('./server/utils/checkForConfig.js');
|
||||||
|
checkForConfig('siteConfig');
|
||||||
|
checkForConfig('mysqlConfig');
|
||||||
|
checkForConfig('slackConfig');
|
||||||
|
checkForConfig('loggerConfig');
|
||||||
|
checkForConfig('siteConfig');
|
||||||
|
|
||||||
// load modules
|
// load modules
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
|
@ -25,17 +32,10 @@ const configureLogging = require('./server/utils/configureLogging.js');
|
||||||
const configureSlack = require('./server/utils/configureSlack.js');
|
const configureSlack = require('./server/utils/configureSlack.js');
|
||||||
const speechPassport = require('./server/speechPassport');
|
const speechPassport = require('./server/speechPassport');
|
||||||
|
|
||||||
// test configs
|
const {
|
||||||
const siteConfig = require('@config/siteConfig');
|
details: { port: PORT },
|
||||||
console.log('siteConfig:', siteConfig);
|
auth: { sessionKey },
|
||||||
const mysqlConfig = require('@config/mysqlConfig');
|
} = require('@config/siteConfig');
|
||||||
console.log('mysqlConfig:', mysqlConfig);
|
|
||||||
const slackConfig = require('@config/slackConfig');
|
|
||||||
console.log('slackConfig:', slackConfig);
|
|
||||||
const loggerConfig = require('@config/loggerConfig');
|
|
||||||
console.log('loggerConfig:', loggerConfig);
|
|
||||||
|
|
||||||
const PORT = siteConfig.details.port;
|
|
||||||
|
|
||||||
function Server () {
|
function Server () {
|
||||||
this.initialize = () => {
|
this.initialize = () => {
|
||||||
|
@ -69,7 +69,6 @@ function Server () {
|
||||||
app.use(requestLogger);
|
app.use(requestLogger);
|
||||||
|
|
||||||
// initialize passport
|
// initialize passport
|
||||||
const sessionKey = siteConfig.auth.sessionKey;
|
|
||||||
app.use(cookieSession({
|
app.use(cookieSession({
|
||||||
name : 'session',
|
name : 'session',
|
||||||
keys : [sessionKey],
|
keys : [sessionKey],
|
||||||
|
|
|
@ -10,6 +10,8 @@ var _reactRedux = require("react-redux");
|
||||||
|
|
||||||
var _reactRouterDom = require("react-router-dom");
|
var _reactRouterDom = require("react-router-dom");
|
||||||
|
|
||||||
|
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
||||||
|
|
||||||
var _reducers = _interopRequireDefault(require("@reducers"));
|
var _reducers = _interopRequireDefault(require("@reducers"));
|
||||||
|
|
||||||
var _GAListener = _interopRequireDefault(require("@components/GAListener"));
|
var _GAListener = _interopRequireDefault(require("@components/GAListener"));
|
||||||
|
@ -18,8 +20,6 @@ var _app = _interopRequireDefault(require("@app"));
|
||||||
|
|
||||||
var _renderFullPage = _interopRequireDefault(require("../renderFullPage.js"));
|
var _renderFullPage = _interopRequireDefault(require("../renderFullPage.js"));
|
||||||
|
|
||||||
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
module.exports = function (req, res) {
|
module.exports = function (req, res) {
|
||||||
|
|
|
@ -16,6 +16,8 @@ var _reduxSaga = _interopRequireDefault(require("redux-saga"));
|
||||||
|
|
||||||
var _effects = require("redux-saga/effects");
|
var _effects = require("redux-saga/effects");
|
||||||
|
|
||||||
|
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
||||||
|
|
||||||
var _reducers = _interopRequireDefault(require("@reducers"));
|
var _reducers = _interopRequireDefault(require("@reducers"));
|
||||||
|
|
||||||
var _GAListener = _interopRequireDefault(require("@components/GAListener"));
|
var _GAListener = _interopRequireDefault(require("@components/GAListener"));
|
||||||
|
@ -26,8 +28,6 @@ var _sagas = _interopRequireDefault(require("@sagas"));
|
||||||
|
|
||||||
var _actions = _interopRequireDefault(require("@actions"));
|
var _actions = _interopRequireDefault(require("@actions"));
|
||||||
|
|
||||||
var _reactHelmet = _interopRequireDefault(require("react-helmet"));
|
|
||||||
|
|
||||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||||
|
|
||||||
var returnSagaWithParams = function returnSagaWithParams(saga, params) {
|
var returnSagaWithParams = function returnSagaWithParams(saga, params) {
|
||||||
|
|
|
@ -3,11 +3,12 @@ import { renderToString } from 'react-dom/server';
|
||||||
import { createStore } from 'redux';
|
import { createStore } from 'redux';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { StaticRouter } from 'react-router-dom';
|
import { StaticRouter } from 'react-router-dom';
|
||||||
|
import Helmet from 'react-helmet';
|
||||||
|
|
||||||
import Reducers from '@reducers';
|
import Reducers from '@reducers';
|
||||||
import GAListener from '@components/GAListener';
|
import GAListener from '@components/GAListener';
|
||||||
import App from '@app';
|
import App from '@app';
|
||||||
import renderFullPage from '../renderFullPage.js';
|
import renderFullPage from '../renderFullPage.js';
|
||||||
import Helmet from 'react-helmet';
|
|
||||||
|
|
||||||
module.exports = (req, res) => {
|
module.exports = (req, res) => {
|
||||||
let context = {};
|
let context = {};
|
||||||
|
|
|
@ -6,12 +6,13 @@ import { StaticRouter } from 'react-router-dom';
|
||||||
import renderFullPage from '../renderFullPage';
|
import renderFullPage from '../renderFullPage';
|
||||||
import createSagaMiddleware from 'redux-saga';
|
import createSagaMiddleware from 'redux-saga';
|
||||||
import { call } from 'redux-saga/effects';
|
import { call } from 'redux-saga/effects';
|
||||||
|
import Helmet from 'react-helmet';
|
||||||
|
|
||||||
import Reducers from '@reducers';
|
import Reducers from '@reducers';
|
||||||
import GAListener from '@components/GAListener';
|
import GAListener from '@components/GAListener';
|
||||||
import App from '@app';
|
import App from '@app';
|
||||||
import Sagas from '@sagas';
|
import Sagas from '@sagas';
|
||||||
import Actions from '@actions';
|
import Actions from '@actions';
|
||||||
import Helmet from 'react-helmet';
|
|
||||||
|
|
||||||
const returnSagaWithParams = (saga, params) => {
|
const returnSagaWithParams = (saga, params) => {
|
||||||
return function * () {
|
return function * () {
|
||||||
|
|
9
server/utils/checkForConfig.js
Normal file
9
server/utils/checkForConfig.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
const logger = require('winston');
|
||||||
|
|
||||||
|
module.exports = (name) => {
|
||||||
|
const config = require(`@config/${name}`);
|
||||||
|
if (!config) {
|
||||||
|
return logger.warn(`Server could not find config file for ${name}.`);
|
||||||
|
}
|
||||||
|
logger.debug(`found ${name} config:`, config);
|
||||||
|
};
|
|
@ -31,7 +31,6 @@ const sendGoogleAnalyticsEvent = (ip, params) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return logger.error('Google Analytics Event Error >>', err);
|
return logger.error('Google Analytics Event Error >>', err);
|
||||||
}
|
}
|
||||||
logger.debug(`Event successfully sent to google analytics`, params);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -42,7 +41,6 @@ const sendGoogleAnalyticsTiming = (siteTitle, params) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return logger.error('Google Analytics Event Error >>', err);
|
return logger.error('Google Analytics Event Error >>', err);
|
||||||
}
|
}
|
||||||
logger.debug(`Timing event successfully sent to google analytics`, params);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue