Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Rewrite not working in v14.2.0

Aperta
#200 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, react
Ambito
web-dev

Direzione di ricerca

Reproduce the report with the public/health.html file, the shown serve.json rewrite, and the serve -s build command. Start by checking how the rewrite configuration is loaded for this command and compare the result with the documented syntax. Done means /health serves health.html while other routes continue serving index.html.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hello, I am using create-react-app to generate my build folder for my SPA and I want to serve a single, standalone html file called health.html that is also in the public folder, like so:
image

A request to localhost:3000/health should serve health.html, and any other requests should serve index.html. For some reason I cannot get this to work at all. From the docs, the following contents of serve.json seems like it is correct, but all requests to /health still redirect to index.html.

{
    "rewrites": [
      { "source": "/health", "destination": "/health.html" }
    ]
}

For reference, I am using this command:

serve -s build

What am I doing wrong?

Lingua principale
JavaScript
Stelle
618
Fork
117
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel/serve-handler

Tutte le issue di vercel/serve-handler

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.