Skip to content

file_server fallback to index.html #3420

@kyeotic

Description

@kyeotic

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

Using statically-generated single page applications, such as those produced by Vite, return 404 for dynamic deep links, since those paths are not backed by real files.

Describe the solution you'd like

An option to fallback to S{fsRoot}/index.html} for missing paths.

Describe alternatives you've considered

  • Use hash routes. Sub-optimal because it impacts user-facing routes
  • Use oak. Sub-optimal for Deno Deploy when compared to
cd dist/ && deployctl deploy --prod --project=$PROJECT_NAME https://deno.land/std@0.171.0/http/file_server.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions