首页 文章

我可以在WAMP服务器上运行Angular 6项目吗?

提问于
浏览
1

我是一名PHP开发人员,我也使用Node.js后端开发了Angular 6应用程序 . 但是,目前我正在开发一个应该运行带有PHP 7后端的Angular 6应用程序的项目 . 原因是,API是用PHP编写的 . 我希望在WAMP服务器默认目录中开发我的Angular应用程序 .

wamp64/www/my_project

所以我的问题是,

  • Angular 6应用程序会运行吗?因为它需要另一台服务器,通常是 http://localhost:4200/.

  • 会有任何服务器(localhost)冲突吗?

  • 如果是,我该怎么办?

  • 另外,我可以在 index.html(or .php) 文件的开头运行 <?php session_start();?> 吗?

1 回答

  • 2

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

    如果您已经在Angular2和node.js组合中编写了任何内容,那么您可以在Heroku等免费服务上托管它以进行测试 .

    and build app using:

    ng build --prod

    复制dist文件夹并将其粘贴到我的xampp htdocs文件夹中并使用以下命令访问该站点:

    localhost:8080 / dist /

    output

    应用程序

相关问题