Allow ServeDir to rewrite path to include .html #383
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-middleware
Topic: middleware
Feature Request
Motivation
Next.js Static Export results in a
/out
directory that looks something likeThis differs slightly from a traditional SPA where all routes would go to index.html, as a request to
/register
should use theregister.html
file.There may be a way to accomplish what I'm asking, but I couldn't figure it out from the docs and/or examples.
I tried use ServeDir as so
Going to
/
correctly returns the index page.Going to
/register.html
correctly returns the register page.But I want
/register
to also return the register page, but it returns 404Proposal
For a given path without any extension, attempt to append
.html
. Similar to append_index_html_on_directories, but could have something such asappend_html_on_directories
where it would only append".html"
rather than"index.html"
to the path.Alternatives
Not sure of any.
The text was updated successfully, but these errors were encountered: