Skip to content

Commit f29e907

Browse files
committed
fix appPath for serving index.html
1 parent 32ab12e commit f29e907

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: app/templates/server/config/express.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,18 @@ module.exports = function(app) {
4242
store: new mongoStore({ mongoose_connection: mongoose.connection })
4343
}));
4444
<% } %>
45+
app.set('appPath', path.join(config.root, 'client'));
46+
4547
if ('production' === env) {
4648
app.use(favicon(path.join(config.root, 'client', 'favicon.ico')));
47-
app.use(express.static(path.join(config.root, 'client')));
48-
app.set('appPath', config.root + '/client');
49+
app.use(express.static(app.get('appPath')));
4950
app.use(morgan('dev'));
5051
}
5152

5253
if ('development' === env || 'test' === env) {
5354
app.use(require('connect-livereload')());
5455
app.use(express.static(path.join(config.root, '.tmp')));
55-
app.use(express.static(path.join(config.root, 'client')));
56-
app.set('appPath', 'client');
56+
app.use(express.static(app.get('appPath')));
5757
app.use(morgan('dev'));
5858
app.use(errorHandler()); // Error handler - has to be last
5959
}

0 commit comments

Comments
 (0)