Skip to content

Rewrite not working in v14.2.0 #200

@Matthematic

Description

@Matthematic

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions