Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angular runtime、styles和PolyFile在我的web服务器上出现404错误_Javascript_Angular_Http Status Code 404 - Fatal编程技术网

Javascript angular runtime、styles和PolyFile在我的web服务器上出现404错误

Javascript angular runtime、styles和PolyFile在我的web服务器上出现404错误,javascript,angular,http-status-code-404,Javascript,Angular,Http Status Code 404,我制作了一个小角度的应用程序,我在我的计算机上构建了它,但是当我试图打开index.html文件时,我有404个错误,我试图将它部署到web服务器上,但它是相同的: GET net::ERR_中止404(未找到) GET net::ERR_中止404(未找到) GET net::ERR_中止404(未找到) 我的index.html文件是: <!doctype html> <html lang="en"> <head> <meta charset="

我制作了一个小角度的应用程序,我在我的计算机上构建了它,但是当我试图打开index.html文件时,我有404个错误,我试图将它部署到web服务器上,但它是相同的:

GET net::ERR_中止404(未找到)

GET net::ERR_中止404(未找到)

GET net::ERR_中止404(未找到)

我的index.html文件是:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>McKenzieEquation</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <script src="assets/js/app.js"></script>
</head>
<body>
  <app-root></app-root>
</body>
</html>

Firefox控制台发送给我的原因是:CORS请求非HTTP错误或此文档中未授权模块源的URI:«file:///polyfills-es2015.2987770fde9daa1d8a2e.js ».

我发现了我的错误。在我的web服务器上,我的页面位于以下路径: /www/mckenzie

我的索引文件是这样写的:

<head>
  <meta charset="utf-8">
  <title>McKenzieEquation</title>
  <base href="/">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <script src="assets/js/app.js"></script>
</head>

麦肯齐方程
我必须用以下代码替换基本参数:

<base href="/mckenzieequation/">

基本href必须指向索引文件的位置

<base href="/mckenzieequation/">