Fix path to retrieve defaults settings and remove useless files

This commit is contained in:
aurelsicoko 2017-07-31 12:12:51 +02:00
parent 8e55bd14a2
commit 937a4839bd
8 changed files with 3 additions and 61 deletions

View File

@ -38,7 +38,7 @@ module.exports = function (strapi) {
initialize: cb => { initialize: cb => {
// Force cache mode in production // Force cache mode in production
if (strapi.config.environment === 'production') { if (strapi.config.environment === 'production') {
strapi.config.hook.ejs.cache = true; strapi.config.hook.settings.ejs.cache = true;
} }
render(strapi.app, strapi.config.hook.settings.ejs); render(strapi.app, strapi.config.hook.settings.ejs);

View File

@ -1,29 +0,0 @@
/**
* NotFoundPage
*
* This is the page we show when the user visits a url that doesn't have a route
*
* NOTE: while this component should technically be a stateless functional
* component (SFC), hot reloading does not currently support SFCs. If hot
* reloading is not a neccessity for you then you can refactor it and remove
* the linting exception.
*/
import React from 'react';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
export default class NotFound extends React.Component {
render() {
return (
<div>
<div className="container">
<h1>
<FormattedMessage {...messages.pageNotFound} />
</h1>
</div>
</div>
);
}
}

View File

@ -1,29 +0,0 @@
/**
* NotFoundPage
*
* This is the page we show when the user visits a url that doesn't have a route
*
* NOTE: while this component should technically be a stateless functional
* component (SFC), hot reloading does not currently support SFCs. If hot
* reloading is not a neccessity for you then you can refactor it and remove
* the linting exception.
*/
import React from 'react';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
export default class NotFound extends React.Component {
render() {
return (
<div>
<div className="container">
<h1>
<FormattedMessage {...messages.pageNotFound} />
</h1>
</div>
</div>
);
}
}

View File

@ -46,7 +46,7 @@ module.exports = function (strapi) {
} }
_.forEach(_.pickBy(strapi.config.connections, {connector: 'strapi-mongoose'}), (connection, connectionName) => { _.forEach(_.pickBy(strapi.config.connections, {connector: 'strapi-mongoose'}), (connection, connectionName) => {
const {host, port, username, password, database} = _.defaults(connection.settings, strapi.config.hook.settings); const {host, port, username, password, database} = _.defaults(connection.settings, strapi.config.hook.settings.mongoose);
// Connect to mongo database // Connect to mongo database
if (_.isEmpty(username) || _.isEmpty(password)) { if (_.isEmpty(username) || _.isEmpty(password)) {

View File

@ -51,7 +51,7 @@ module.exports = function(strapi) {
// For each connection in the config register a new Knex connection. // For each connection in the config register a new Knex connection.
_.forEach(connections, (connection, name) => { _.forEach(connections, (connection, name) => {
// Apply defaults // Apply defaults
_.defaults(connection.settings, strapi.hook.redis.defaults); _.defaults(connection.settings, strapi.config.hook.settings.redis);
try { try {
const redis = new Redis(_.defaultsDeep({ const redis = new Redis(_.defaultsDeep({