Angular project compiles but localhost:4200 returns a 404 error

Discussão em 'Angular' iniciado por TheIronCheek, Março 5, 2025.

  1. TheIronCheek

    TheIronCheek Guest

    I'm brand new to Angular and I inherited a legacy application that I'm trying to get running on my local machine. After pulling the code from the repo and installing all the dependencies, I'm running npm start to try to run the application. Here's what npm is telling me:

    C:\dev\MyApp\MyApp.Web>npm start

    > MyApp@1.0.0 start C:\dev\MyApp\MyApp.Web
    > ng serve --proxy-config proxy.config.json --ssl true

    Browserslist: caniuse-lite is outdated. Please run next command `npm update`

    Date: 2025-03-05T20:24:04.968Z
    Hash: 44b22a9fe2cd741579dc
    Time: 19278ms
    chunk {main} main.js, main.js.map (main) 6.06 MB [initial] [rendered]
    chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 149 kB [initial] [rendered]
    chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 434 kB [initial] [rendered]
    chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
    chunk {scripts} scripts.js, scripts.js.map (scripts) 702 kB [entry] [rendered]
    chunk {styles} styles.js, styles.js.map (styles) 967 kB [initial] [rendered]
    chunk {vendor} vendor.js, vendor.js.map (vendor) 5.56 MB [initial] [rendered]
    ** Angular Live Development Server is listening on localhost:4200, open your browser on https://localhost:4200/ **
    i 「wdm」: Compiled successfully.


    But when I go to https://localhost:4200, I get a 404 error. What could be happening here?

    EDIT:

    Per request from the comments, I'm including my proxy.config.json here:

    {
    "/Identity": {
    "target": "https://localhost:5001",
    "secure": false
    },
    "/Files": {
    "target": "https://localhost:5001",
    "secure": false
    },
    "/api": {
    "target": "https://localhost:5001",
    "secure": false
    },
    "/_configuration": {
    "target": "https://localhost:5001",
    "secure": false
    },
    "/.well-known": {
    "target": "https://localhost:5001",
    "secure": false
    },
    "/connect": {
    "target": "https://localhost:5001",
    "secure": false
    }
    }


    https://localhost:5001 is returning a 404 too.

    Continue reading...

Compartilhe esta Página