Skip to content

Commit

Permalink
Serve index.html when in app.asar (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibash authored Nov 20, 2020
1 parent 9636bee commit 1f196d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ module.exports = options => {
const indexPath = path.join(options.directory, 'index.html');
const filePath = path.join(options.directory, decodeURIComponent(new URL(request.url).pathname));
const resolvedPath = await getPath(filePath);
const fileExtension = path.extname(filePath);

if (resolvedPath || !path.extname(filePath) || path.extname(filePath) === '.html') {
if (resolvedPath || !fileExtension || fileExtension === '.html' || fileExtension === '.asar') {
callback({
path: resolvedPath || indexPath
});
Expand Down

0 comments on commit 1f196d3

Please sign in to comment.