Angular CLI dist url在浏览器中不起作用

时间:2019-06-13 12:49:10

标签: angular angular-cli

我已经创建了一个Angular项目,运行命令ng build --prod后成功创建了dist文件夹。运行http-server ./dist

之后
Starting up http-server, serving ./dist
Available on:
  http://53.88.125.168:8082
  http://127.0.0.1:8082

但是当我单击以上http网址之一时。浏览器返回类似

This page isn’t working 127.0.0.1 sent an invalid response.

HTML

    <!DOCTYPE html>
<html>
  <head>
    <title>Dashboard</title>
    <base href="/">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="styles.css">


    <!-- Polyfills -->
    <script src="../node_modules/core-js/client/shim.min.js"></script>

    <script src="../node_modules/zone.js/dist/zone.js"></script>
    <script src="../node_modules/systemjs/dist/system.src.js"></script>
    <script src="systemjs.config.js"></script>
    <script>
      System.import('main.js').catch(function(err){ console.error(err); });
    </script>
  </head>

  <body>
    <my-app><!-- content managed by Angular --></my-app>
  </body>

</html>

enter image description here

enter image description here

enter image description here

看起来有些代理问题。专家请教?

0 个答案:

没有答案