Serving files
Static file serving
The utilities component @stricjs/utils
provides 2 ways to serve static files.
Searching
Use the stream
method to create a function to search for files based on the request pathname.
Grouping
Use the group
method to create a router group that handle each file as a route.
This method is way faster than file searching but with drawbacks:
Files shouldn't be deleted.
More files can't be added after running.
High memory usage if you have many files.
Last updated