Skip to content

Commit 1f196d3

Browse files
authored
Serve index.html when in app.asar (#26)
1 parent 9636bee commit 1f196d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ module.exports = options => {
3838
const indexPath = path.join(options.directory, 'index.html');
3939
const filePath = path.join(options.directory, decodeURIComponent(new URL(request.url).pathname));
4040
const resolvedPath = await getPath(filePath);
41+
const fileExtension = path.extname(filePath);
4142

42-
if (resolvedPath || !path.extname(filePath) || path.extname(filePath) === '.html') {
43+
if (resolvedPath || !fileExtension || fileExtension === '.html' || fileExtension === '.asar') {
4344
callback({
4445
path: resolvedPath || indexPath
4546
});

0 commit comments

Comments
 (0)