Skip to content

[Enhancement]: Serve static files statically #367

@mrjvs

Description

@mrjvs

Checked Existing

  • I have checked the repository for duplicate issues.

What enhancement would you like to see?

Currently we have a router called web.ts that serves static files with custom headers and such.
This needs to be replaced with a express-static module:

  • It will improve caching
  • Correct content-type will then be sent
  • No longer need to add routes per file-type, everything in the folder will be served

There's two approaches:

  • Have a express-static per subdomain.
    • Pro: hard-boundary between platforms
    • Con: harder to debug what file you're receiving if it's bugged, cuz of dynamic routes.
  • Have one express-static and have the platform as part of the filepath: /ctr/my-styles.css
    • Pro: Easy to trace what static files are coming from where, just a single folder to serve
    • Con: Assets for different platforms can be requested from any subdomain

Would appreciate some input from @ashquarky on which approach to take

Any other details to share? (OPTIONAL)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    approvedThe topic is approved by a developerenhancementAn update to an existing part of the codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions