denoland / denoland/std

try_files for @std/http/file_server

Open
#5,875 4 comments 0 reactions 0 assignees View on GitHub
feedback welcome http suggestion
Dominant language
TypeScript
Stars
3.6k
Forks
681
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

there is currently no built-in way to attempt to serve a file from a directory and then handle when the file doesn't exist.

**Describe the solution you'd like**

a function similar to serveDir or serveDir itself but will throw or hand off back in some way to the caller to deal with when a file is missing, similar to the [try_files directive in nginx](https://nginx.org/en/docs/http/ngx_http_core_module.html#try_files).

**Describe alternatives you've considered**

building my own solution but i feel this would be a common enough use case to have as part of the standard library.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.