简体   繁体   English

部署Symfony2后端REST API和前端SPA javascript应用

[英]Deploying a Symfony2 back-end REST API and a front-end SPA javascript app

Doing a one page application on one side and a REST API to get the ressources on the other side is something a lot companies do. 许多公司都在一方面做一个页面应用程序,而在另一边做一个REST API来获取资源。 I've been doing a pet project consisting on a REST API built with the Symfony2 framework and a SPA with Web Components and Polymer. 我一直在做一个宠物项目,该项目由使用Symfony2框架构建的REST API和带有Web组件和Polymer的SPA组成。 The SPA is doing AJAX requests to get the ressources. SPA正在执行AJAX请求以获取资源。

Now I'm wondering how to deploy it on the web. 现在我想知道如何在网络上部署它。 I don't have a lot of experience with deployment and I'd like to know if there are best practices to deploy a web app and where to do it. 我没有太多的部署经验,我想知道是否存在部署Web应用程序以及在何处进行部署的最佳实践。

I've looked at Heroku and the git push is very convenient but I don't know if (of how) I can push my 2 apps on the same dyno and handle the routing between the two. 我已经看过Heroku了,git push非常方便,但是我不知道(是否可以)在同一个dyno上推送我的2个应用程序并处理两者之间的路由。

Any idea on how to deploy such architecture? 关于如何部署这种架构的任何想法?

You should look at using a deployment manager such as Capistrano . 您应该考虑使用诸如Capistrano之类的部署管理器。 Symfony has it's own version which can be useful. Symfony有自己的版本 ,可能会有用。 Both a written in Ruby, whilst I like using Magallanes as it has most of the same functionality but is written in PHP so less dependencies and easier to modify. 两者都是用Ruby编写的,而我喜欢使用Magallanes,因为它具有大多数相同的功能,但都是用PHP编写的,因此依赖性更少,更易于修改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM