1 | const fs = require("fs-extra");
|
2 | const paths = require("../../config/paths");
|
3 | const chalk = require('chalk');
|
4 | const log = console.log;
|
5 |
|
6 | const defaultConfig = {
|
7 | middleware:["createReactApp"]
|
8 | }
|
9 |
|
10 | module.exports = ()=>{
|
11 | let config = defaultConfig
|
12 |
|
13 | if(fs.existsSync(paths.appDir +"/express-server-config.js")){
|
14 | log(`${chalk.blue("Loading Custom Express Server Config")}`);
|
15 | config = require(paths.appDir +"/express-server-config.js")(defaultConfig);
|
16 | }
|
17 | config.middleware = config.middleware.map(middleware=>"express/"+middleware);
|
18 |
|
19 | return config;
|
20 | } |
\ | No newline at end of file |