Skip to content

Static assets middleware #34

@breezykermo

Description

@breezykermo

With the addition of sources in Timemap, it has become evident that ds-s would benefit from middleware that can serve static assets.

The infrastructure for middleware already exists, and a simple version of this could be easily written that just exposes the assets in some subdirectory at a given prefix on ds-s.

It would be good in general, however, for middleware to also be able to hook into blueprinter functions, so that it can modify not only the routes that are available on ds-s, but also the structure and nature of the data in certain blueprints. Specifically for static asset middleware, this would be useful to allow the middleware to prefix paths loaded from a datasheet with the appropriate domain name/prefix on ds-s, so that such information does not need to be 'hardcoded' into the sheets themselves. There would still be coupling between the datasheet and the static directory structure, as the pathnames of the static assets could not be dynamic--but it would prevent details of ds-s configuration--the prefix of static assets--from needing to be manually curated in the datsheet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions