bem / bem-express

BEM project-stub with BEMTREE and express
44 stars 20 forks source link

Resolve paths to support arbitrary cwd #138

Closed tadatuta closed 6 years ago

tadatuta commented 7 years ago
diff --git server/index.js server/index.js
index 5a9afdc..7a099df 100644
--- server/index.js
+++ server/index.js
@@ -16,7 +16,7 @@ var fs = require('fs'),
     compression = require('compression'),

     config = require('./config'),
-    staticFolder = config.staticFolder,
+    staticFolder = path.resolve(__dirname, '..', config.staticFolder),

     Render = require('./render'),
     render = Render.render,
diff --git server/render.js server/render.js
index 4c0c1ec..7cbe8f2 100644
--- server/render.js
+++ server/render.js
@@ -4,7 +4,7 @@ var fs = require('fs'),
     config = require('./config'),

     bundleName = 'index',
-    pathToBundle = path.resolve('desktop.bundles', bundleName),
+    pathToBundle = path.resolve(__dirname, '..', 'desktop.bundles', bundleName),

     isDev = process.env.NODE_ENV === 'development',
     templates = getTemplates(),