init of the sanitize config rework and custom component config setup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const initCORS = ({ config, app }) => {
|
||||
const initCORS = (app, config) => {
|
||||
if (config.cors) {
|
||||
app.use((req, res, next) => {
|
||||
if (config.cors.indexOf(req.headers.origin) > -1) {
|
||||
|
||||
@@ -4,7 +4,7 @@ const bodyParser = require('body-parser');
|
||||
const methodOverride = require('method-override');
|
||||
const localizationMiddleware = require('../localization/middleware');
|
||||
|
||||
const registerExpressMiddleware = ({ app, config, router }) => {
|
||||
const registerExpressMiddleware = (app, config, router) => {
|
||||
app.use(express.json());
|
||||
app.use(methodOverride('X-HTTP-Method-Override'));
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const express = require('express');
|
||||
|
||||
const initUploads = ({ config, app }) => {
|
||||
const initUploads = (app, config) => {
|
||||
const staticUrl = config.staticUrl ? config.staticUrl : `/${config.staticDir}`;
|
||||
app.use(staticUrl, express.static(config.staticDir));
|
||||
};
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
const webpack = require('webpack');
|
||||
const webpackDevMiddleware = require('webpack-dev-middleware');
|
||||
const webpackHotMiddleware = require('webpack-hot-middleware');
|
||||
const path = require('path');
|
||||
const getWebpackDevConfig = require('../client/config/getWebpackDevConfig');
|
||||
|
||||
const initWebpack = ({ config, app }) => {
|
||||
const initWebpack = (app, config) => {
|
||||
const webpackDevConfig = getWebpackDevConfig(config);
|
||||
const compiler = webpack(webpackDevConfig);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user