From a5049e0378e5367bdc368e3de55f5b2859f81c86 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 27 Dec 2018 22:12:33 +0700 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=B5=D1=81=20publicDir=20?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/config/base.js | 1 + server/config/production.js | 1 + server/index.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/config/base.js b/server/config/base.js index c5481f15..66282d8d 100644 --- a/server/config/base.js +++ b/server/config/base.js @@ -7,6 +7,7 @@ module.exports = { tempDir: execPath + '/tmp', logDir: execPath + '/log', dataDir: execPath + '/data', + publicDir: execPath + '/public', dbFileName: 'db.sqlite', loggingEnabled: true, diff --git a/server/config/production.js b/server/config/production.js index 796e1913..42422703 100644 --- a/server/config/production.js +++ b/server/config/production.js @@ -8,5 +8,6 @@ module.exports = Object.assign({}, base, { tempDir: execPath + '/tmp', logDir: execPath + '/log', dataDir: execPath + '/data', + publicDir: execPath + '/public', } ); diff --git a/server/index.js b/server/index.js index efe2cc12..40addcac 100644 --- a/server/index.js +++ b/server/index.js @@ -32,7 +32,7 @@ async function main() { })); } - app.use(express.static('public')); + app.use(express.static(config.publicDir)); app.use(express.json()); require('./routes').initRoutes(app, connPool, config);