Skip to content

Dev server (ng serve) should return HTTP 404 for assets requests for broken/non-existent urls #2989

Closed
@IgorMinar

Description

@IgorMinar

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

MacOS El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.19-3
node: 6.7.0
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

build an app and in the html template load an image that doesn't exist in the source repo

<img src="does/not/exist">

The log given by the failure.

Normally this include a stack trace and some more information.

dev server (ng serve) responds with HTTP 200 (and serves the contents index.html in the response) instead of HTTP 404.

Mention any other details that might be useful.

Please see johnpapa/lite-server#51 for explanation of why this results in very poor development experience and suggested fixes.


Thanks! We'll be in touch soon.

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