Can I run an Angular 6 project on WAMP Server?

2019-05-16 16:42发布

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条回答
来,给爷笑一个
2楼-- · 2019-05-16 16:58

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

查看更多
登录 后发表回答