Authored by 陈峰

修改生产环境配置

.DS_Store
.idea
app/build/bundle
server/public/
node_modules/
*.log
.eslintcache
app/bundle
\ No newline at end of file
app/bundle
server/public/*.html
\ No newline at end of file
... ...
... ... @@ -5,10 +5,10 @@ module.exports = {
env: {
NODE_ENV: '"production"'
},
index: path.resolve(__dirname, './bundle/index.html'),
index: path.resolve(__dirname, '../../server/public/index.html'),
assetsRoot: path.resolve(__dirname, './bundle'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
assetsPublicPath: 'http://shop-manage.yohobuy.com/',
productionSourceMap: true,
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
... ...
... ... @@ -19,6 +19,7 @@
"bluebird": "^3.5.0",
"body-parser": "^1.17.1",
"compression": "^1.6.2",
"connect-history-api-fallback": "^1.3.0",
"connect-multiparty": "^2.0.0",
"cookie-parser": "^1.4.3",
"cookie-session": "^2.0.0-beta.1",
... ...
... ... @@ -9,6 +9,7 @@ const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const compression = require('compression');
const Express = require('express');
const history = require('connect-history-api-fallback');
// const session = require('express-session');
const cookieSession = require('cookie-session');
... ... @@ -30,7 +31,11 @@ global.yoho = {
apiDomain: config.apiDomain,
co: global.Promise.coroutine
};
app.use(history({
rewrites: [
{ from: /\.html/, to: '/index.html'}
]
}));
app.use(cookieSession({
name: 'yoho-shop',
secret: 'yoho!shop@manage',
... ... @@ -41,6 +46,7 @@ app.use(cookieSession({
app.use(compression());
app.use(favicon(path.join(__dirname, '/favicon.ico')));
app.use(Express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(cookieParser());
... ...