[英]404 error when deploying angular sample app in production mode
Following an Angular tutorial about deploying the app locally in production mode i failed to do so even using the sample app. 遵循有关在生产模式下本地部署应用程序的Angular教程之后,即使使用示例应用程序,我也未能做到。 Steps:
脚步:
ng new prod-app
ng build --prod
http-server /dist/prod-app
<-- Used in tutorial http-server /dist/prod-app
<-在教程中使用 lite-server --baseDir="dist/prod-proj"
<-- In Angular Docs lite-server --baseDir="dist/prod-proj"
<-在Angular Docs中 using both servers result in the same behavior, Blank page an a 404 error 使用两个服务器导致相同的行为,空白页出现404错误
F:\AngularApps\prod-proj>lite-server --baseDir="dist"
Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
** browser-sync config **
{ injectChanges: false,
files: [ './**/*.{html,htm,css,js}' ],
watchOptions: { ignored: 'node_modules' },
server: { baseDir: 'dist', middleware: [ [Function], [Function] ] } }
[Browsersync] Access URLs:
-------------------------------------
Local: http://localhost:3000
External: http://192.168.56.1:3000
-------------------------------------
UI: http://localhost:3001
UI External: http://localhost:3001
-------------------------------------
[Browsersync] Serving files from: dist
[Browsersync] Watching files...
19.08.16 08:49:20 404 GET /index.html
19.08.16 08:49:20 404 GET /favicon.ico
There is nothing in neither the tutorial nor the docs about any extra configuration, So what am i missing? 教程和文档中都没有关于任何额外配置的内容,那么我缺少什么?
Thanks, Gado 谢谢加多
在lite-server输出中,您已指定baseDir="dist"
,将其更改为baseDir="dist/prod-proj"
F:\AngularApps\prod-proj>lite-server --baseDir="dist/prod-proj"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.