简体   繁体   English

在Google App Engine上运行Bottle(后端)+ Nodejs(前端)

[英]Running Bottle (back end) + Nodejs (front end) on Google App Engine

I have my Python/bottle backend running on app engine and decided to use Nodejs/ember for the front end. 我的Python /瓶子后端在应用程序引擎上运行,并决定将Nodejs / ember用作前端。 I haven't used Google Cloud a lot but the Managed VMs beta seems to allow me to deploy my project using Docker. 我没有用过很多Google Cloud,但是Managed VMs beta似乎允许我使用Docker部署项目。

Question: How do I run both back end and front end on the Google cloud and can I actually run it in the same project? 问题:如何在Google云上同时运行后端和前端,是否可以在同一项目中运行它? I haven't found any documentation how to do the configuration. 我还没有找到任何有关如何进行配置的文档。 I'm sure there is a simple answer that I'm not seeing. 我确定我没有看到一个简单的答案。

The first thing to consider is that Node.js and Ember.js are separate things. 首先要考虑的是Node.js和Ember.js是分开的。 Node.js allows for writing javascript as a server side language. Node.js允许将javascript作为服务器端语言编写。 This means that it is used as a webserver (backend) not as client side code (front end). 这意味着它将用作网络服务器(后端),而不用作客户端代码(前端)。 So Node.js would replace your python/bottle. 因此,Node.js将替换您的python / bottle。 (specially if used with Express.js for middleware). (特别是与Express.js一起用于中间件时)。

Secondly you do not need to host the "frontend" on anything. 其次,您不需要在任何东西上托管“前端”。 In most modern web apps the "frontend" is served by your backend (python/bottle) to the user's browser whenever they travel to the web url. 在大多数现代的Web应用程序中,无论何时用户访问Web URL,“前端”都是由您的后端(python /瓶)提供给用户的浏览器。

Because ember has a very full routing system you just have to serve the main index page along with the assets and it will take over the routing for you. 由于ember具有非常完整的路由系统,因此您只需将主索引页面与资产一起提供,它将为您接管路由。

Finally you can host an python/bottle (backend) Ember.js(front-end) application on google cloud. 最后,您可以在Google Cloud上托管python / bottle(后端)Ember.js(前端)应用程序。

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

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