node.js - 新的 Angular 8 应用程序返回 http 400
问题描述
我面临一个奇怪的错误。我正在创建新的干净的 angular 8 应用程序并成功构建代码,但尝试在 localhost:4200(或我更改为的任何端口)打开应用程序应用程序返回http 400
我添加了构建信息。卸载node js并重新安装它仍然一样
10% building 3/3 modules 0 activei 「wds」: Project is running at http://localhost:4200/webpack-dev-server/
i 「wds」: webpack output is served from /
i 「wds」: 404s will fallback to //index.html
chunk {main} main.js, main.js.map (main) 49.4 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 264 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 10.1 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 4.08 MB [initial] [rendered]
Date: 2019-10-21T10:00:41.976Z - Hash: 8acb354556900c2f8710 - Time: 9192ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
i 「wdm」: Compiled successfully.
解决方案
nodejs 应用程序中的 server.js 文件中可能有一些内容。您是否允许来自所有网址的请求?您需要启用跨域资源共享。
推荐阅读
- r - 用 R 修改列表中的数据框
- ios - 在 IOS 12.1 上使用 WIFI 时我的应用程序停止
- r - 如何在 ggplot 中使用变量度量(误差线)?
- javascript - JavaScript 回调返回结果,但函数变量未定义
- r - 使用 r 中 dplyr 中的 mutate_all() 将 df 中的每一列除以其他列
- javascript - 如何在返回值之前完全解决 axios/fetch call/promise?
- cassandra - Cassandra 数据建模 IoT 最佳实践
- android - Java:数独拼图生成无法正常工作
- pytest - 使用 tox 运行时,如何使 pytest 测试可以访问测试数据文件?
- javascript - 渲染上的意外令牌反应