Skip to content

Commit c5d3fe3

Browse files
authored
Merge pull request #1388 from linonetwo/patch-1
Get valid mashlib html file location
2 parents e78d8b9 + 9c994d5 commit c5d3fe3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/create-app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function createApp (argv = {}) {
6767

6868
// Serve the public 'common' directory (for shared CSS files, etc)
6969
app.use('/common', express.static(path.join(__dirname, '../common')))
70-
app.use('/', express.static(path.join(__dirname, '../node_modules/mashlib/dist'), { index: false }))
70+
app.use('/', express.static(path.dirname(require.resolve('mashlib/dist/index.html')), { index: false }))
7171
routeResolvedFile(app, '/common/js/', 'solid-auth-client/dist-lib/solid-auth-client.bundle.js')
7272
routeResolvedFile(app, '/common/js/', 'solid-auth-client/dist-lib/solid-auth-client.bundle.js.map')
7373
app.use('/.well-known', express.static(path.join(__dirname, '../common/well-known')))

lib/handlers/get.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async function handler (req, res, next) {
8989

9090
if (useDataBrowser) {
9191
res.set('Content-Type', 'text/html')
92-
const defaultDataBrowser = _path.join(__dirname, '../../node_modules/mashlib/dist/index.html')
92+
const defaultDataBrowser = require.resolve('mashlib/dist/index.html')
9393
const dataBrowserPath = ldp.dataBrowserPath === 'default' ? defaultDataBrowser : ldp.dataBrowserPath
9494
debug(' sending data browser file: ' + dataBrowserPath)
9595
res.sendFile(dataBrowserPath)

0 commit comments

Comments
 (0)