我使用angularcli创建角2个应用程序,现在我需要检查它在直播服务器,我的问题是,角2项目托管
1. do I have export whole project or what are the option I have?.
2. Can we run it in apache 2 server or we need to use specific server?.
我使用angularcli创建角2个应用程序,现在我需要检查它在直播服务器,我的问题是,角2项目托管
1. do I have export whole project or what are the option I have?.
2. Can we run it in apache 2 server or we need to use specific server?.
是的,不需要部署应用程序的源代码。您可以在Apache服务器下运行构建的对象文件。
ng build --prod
或ng build --prod --aot
将构建您的项目到dist文件夹中。只需将dist文件夹的内容部署到Apache服务器即可。
你可以简单地使用运行应用程序:
ng serve
该应用程序将开始运行在http://localhost:4200/
。指定自定义主机和端口为:
ng serve --host 0.0.0.0 --port 4201
否我需要在远程服务器man中运行我的应用程序。本地机器运行没有问题。 –
现在有很多免费的云平台可用于托管angular2应用程序,如AWS(亚马逊服务),Micro soft和Heroku的Azure。
我使用Heroku托管我的angular2应用程序。它是免费的,但你必须提供你的信用卡详细信息,以便与MongoDB服务器(MLAB)链接。
Refer the below Heroku link for the step by step instructions.
节点模块呢? –
如果您想在Apache服务器生成后为您的应用程序提供服务,则不需要node_modules。 – Martin
我还在我的项目中使用了vaadin聚合物元素,他们在凉亭文件中做了什么? –