Skip to content

expressStaticGzip fail to handle single file #13

Open
@FranckFreiburger

Description

@FranckFreiburger

Like serve-static, express-static-gzip should also be able to serve a single file.
eg:
expressApp.use('/service-worker.js', expressStaticGzip('service-worker.js'));

Currently, the error is:

Error: ENOTDIR: not a directory, scandir 'C:\test\dist\service-worker.js'
    at Object.fs.readdirSync (fs.js:909:18)
    at findAllCompressionFiles (C:\test\node_modules\express-static-gzip\index.js:127:24)
    at expressStaticGzip (C:\test\node_modules\express-static-gzip\index.js:28:9)
    at serve (C:\test\myserver.js:344:10)
    ...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions