Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

path ignored for unversioned files #36

Copy link
Copy link
@benmccann

Description

@benmccann
Issue body actions

I include staticify like this:

const staticify = require('staticify')(path.join(__dirname, 'public'), { pathPrefix: '/public' });
app.use('/public', staticify.middleware);

This works when I receive requests for versioned files, but not if I request the file without including the hash

I can work around the issue using the code below, but it'd be nice if staticify.middleware did this for me

    if (!isProd) {    
        app.use(function(req, res, next) {
            if (req.url.startsWith('/javascripts') || req.url.startsWith('/css')) {
                req.url = '/public/' + req.url;
            }
            next();
        });
    }
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.