Can I run an Angular 6 project on WAMP Server?

隐身守侯 提交于 2019-12-06 07:06:59

问题


I am a PHP developer and also I have developed Angular 6 apps using Node.js backend. But, currently I am working on a project which should run an Angular 6 app with a PHP 7 back-end. The reason is that, the API was written in PHP. I wish to develop my Angular app in WAMP server default directory.

wamp64/www/my_project

So my questions are,

  1. Will the Angular 6 app run? Because it needs another server and normally it is http://localhost:4200/.
  2. Would there any server (localhost) collisions?
  3. If it is, what should I do?

  4. Also, can I run <?php session_start();?> on the beginning of index.html(or .php) file?


回答1:


You can write Angular2 app just using Angular2 packages without using node or mamp or xampp and host that app.

If you have written any thing in Angular2 and node.js combination then you can host it on free services like Heroku for testing purpose.

and build app using:

ng build --prod

copy dist folder and paste it in my xampp htdocs folder and access the site using:

localhost:8080/dist/

output

App works



来源:https://stackoverflow.com/questions/51748574/can-i-run-an-angular-6-project-on-wamp-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!