请帮我解决这个问题
我尝试了带有“http”和“https”的 URL,但它不起作用 https://本地主机:4200/ http://localhost:4200/
好吧,如果您编译了代码,生成了 SPA(简单页面应用程序)并且需要 http 服务器来发布它(Apache、NGIX 等) 如果你想开发和调试代码,你必须使用 `
ng serve --port 4200
` 或您想要使用的任何端口,在控制台中(假设您使用 VSCode 进行编码)或在项目根路径的终端中(通常是 package.json 和其余配置文件) serve 是一个 agular CLI 工具,它编译和发布 html 代码(实际上几乎代码都是 JS)