Skip to content

Exclusion list for static files middleware #548

@fastbike

Description

@fastbike

On of our projects has all of the ui designed by an external web agency. They deliver us a file structure like this

\www
    \html
    \js
    \img
    \css
    \etc

We point our static files middleware to the root directory so that the js/css/img/etc files can be served directly. However we wish to exclude the html directory as it contains page fragments that need to be rendered by the mustache engine (effectively it is our ui source code)

Currently we handle this with a separate middleware which blocks the static files middleware from serving specified directories under the "\www" root, such as the html directory.

I'm thinking this must be a common situation and would like to propose a solution, some ideas I'm considering are:

  • add an optional param to the current middleware constructor, or
  • inject an additional filter object into the current middleware constructor, or
  • add a filter property to the current middleware

I'll look into this in the coming week, but in the meantime happy to hear any other thoughts.

Metadata

Metadata

Labels

acceptedIssue has been accepted and inserted in a future milestoneenhancement

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions