Skip to content

Improved hosting of static files in Relic #2498

Closed

Description

@vlidholt

Serverpod's web server, Relic, supports hosting static files through the RouteStaticDirectory. It currently has limited functionality and is a bit fiddly and difficult to understand how to configure. We can improve the interface and take inspiration from shelf_static, who seems to have done a better job at handling MIME types, listing directories, etc. We can move code from shelf_static to serverpod_relic_helpers as needed.

RouteStaticDirectory can have the following constructor. It will serve files from the provided directory but place them under the path specified by the Router (see #2489).

RouteStaticDirectory({
  required String fileSystemPath,
  String? defaultDocument,
  bool listDirectories = false,
  bool useHeaderBytesForContentType = false,
  MimeTypeResolver? contentTypeResolver,
});

Activity

  1. added
    enhancement
    on Jul 18, 2024
  2. added
    area: web server
    on Aug 29, 2024
  3. moved this to Later 🥳 in Serverpod Frameworkson Mar 5, 2025
  4. moved this to Later 🥳 in Serverpod Frameworkson Jun 16, 2025
  5. moved this from Later 🥳 to Next 🌟 in Serverpod Frameworkson Jun 16, 2025
  6. self-assigned this
    on Sep 1, 2025
  7. moved this from Next Up 🎯 to In Progress 🔥 in Serverpod Frameworkson Sep 10, 2025
  8. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: web serverenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions