我如何在 wamp 中 运行 一个 angular 6 应用程序?

How can i run an angular 6 application in wamp?

我有一个 angular 6 应用程序,我想安装在 Apache 服务器上,可以吗?? 我不想安装 ngix。是否可以 运行 Apache 服务器上的应用程序?

如果您必须部署 Angular 应用程序,您可以按照 link 的说明进行操作:

'https://angular.io/guide/deployment'

只需使用 'ng build' 构建项目,然后将 './dist/' 中的文件夹复制到 apache 服务器 www 目录中的项目名称。

您一定可以使用 Apache 为您的应用程序提供服务。

您需要根据您的 Angular 应用程序目录配置您的 DocumentRoot。

此外,您需要像下面这样配置 ReWriteEngine:

RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html

关注link了解更多详情: https://angular.io/guide/deployment

谢谢, 单位