Skip to content

Commit

Permalink
feat: configurable view directory (#1400)
Browse files Browse the repository at this point in the history
  • Loading branch information
XadillaX authored and fengmk2 committed Oct 26, 2018
1 parent 3497bae commit 90580a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/index.js
Expand Up @@ -47,6 +47,9 @@ var config = {
// web page viewCache
viewCache: false,

// view files directory
viewDir: path.join(root, 'view', 'web'),

// config for koa-limit middleware
// for limit download rates
limit: {
Expand Down
2 changes: 1 addition & 1 deletion servers/web.js
Expand Up @@ -59,7 +59,7 @@ if (config.enableCompress) {
app.use(conditional());
app.use(etag());

var viewDir = path.join(rootdir, 'view', 'web');
var viewDir = config.viewDir || path.join(rootdir, 'view', 'web');
var docDir = path.join(rootdir, 'docs', 'web');

var layoutFile = path.join(viewDir, '_layout.html');
Expand Down

0 comments on commit 90580a7

Please sign in to comment.