Browse Source

Вынес publicDir в конфиг

Book Pauk 6 years ago
parent
commit
a5049e0378
3 changed files with 3 additions and 1 deletions
  1. 1 0
      server/config/base.js
  2. 1 0
      server/config/production.js
  3. 1 1
      server/index.js

+ 1 - 0
server/config/base.js

@@ -7,6 +7,7 @@ module.exports = {
     tempDir: execPath + '/tmp',
     tempDir: execPath + '/tmp',
     logDir: execPath + '/log',
     logDir: execPath + '/log',
     dataDir: execPath + '/data',
     dataDir: execPath + '/data',
+    publicDir: execPath + '/public',
     dbFileName: 'db.sqlite',
     dbFileName: 'db.sqlite',
     loggingEnabled: true,
     loggingEnabled: true,
 
 

+ 1 - 0
server/config/production.js

@@ -8,5 +8,6 @@ module.exports = Object.assign({}, base, {
         tempDir: execPath + '/tmp',
         tempDir: execPath + '/tmp',
         logDir: execPath + '/log',
         logDir: execPath + '/log',
         dataDir: execPath + '/data',
         dataDir: execPath + '/data',
+        publicDir: execPath + '/public',
     }
     }
 );
 );

+ 1 - 1
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());
     app.use(express.json());
 
 
     require('./routes').initRoutes(app, connPool, config);
     require('./routes').initRoutes(app, connPool, config);