-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
I would like to indicate a route for all static files and their subfolders.
To be able to access the assets from the route: 'domain.com/public/file.css'
Example:
app.use('/public', staticify.middleware);However, by doing this, the 'getVersionedPath' method no longer works correctly.
I have browsed the code and modified it a bit, adding 'route' in the staticify options.
Example:
staticify(path.join(__dirname, './public'), { route: '/public' })And I added this value in the 'buildVersionHash' method on line 57:
vers[`${opts.route}/${path.posix.relative(root, filePath)}`] = hash;In this way the express route worked.
I know that validations were missing and possibly not the best way to do it, but I share it in case in the future they could officially include this possibility.
Thanks for staticify!
Metadata
Metadata
Assignees
Labels
No labels