如何使用Apache运行Angular 4 [英] How make run Angular 4 with Apache
问题描述
我实际上在运行Angular 4项目时遇到了Ubuntu Server 16.04 LTS,该服务器在其中安装了Node JS,但我想更改配置以使其仅使用apache运行,这可行吗?如果是,该怎么办?
I am actually running my Angular 4 project trought an Ubuntu server 16.04 LTS where I setup Node JS but I would like to change the config to make it run only with apache, is that posible? If yes how to do that?
提前感谢您的来信
推荐答案
要从Web服务器(例如Apache)运行Angular应用,您需要先构建运行时程序包(例如,通过AngulaCli ng build命令),然后部署打包到Apache.
To run an Angular app from a web server (e.g. Apache) you need first to build a runtime package (e.g. via AngulaCli ng build command) and then deploy the package to Apache.
将要下载的唯一html文件是index.html
The only html file which will be downloaded will be index.html
其余所有应用程序(js,css和其他资产)将由Angular从那里自动下载(这是单页应用程序模型)
All the rest of the app (js, css, other assets) will be downloaded automatically from there by Angular (this is the Single Page App model)
这篇关于如何使用Apache运行Angular 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!