是否可以使用 Node.js 或其他一些服务器端 JavaScript 方法开发 Google App Engine 网络应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3927199/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 02:42:51  来源:igfitidea点击:

Is it possible to develop a Google App Engine web app using Node.js or some other server side JavaScript approach?

javascriptgoogle-app-enginenode.jsserverside-javascript

提问by Michael O'Faolain

I've been following the latest developments with server-side JavaScript - especially Node.js - and wondering if there is any possibility of using such an approach to develop a Google App Engine web application - either separately from or in combination with Python or Java?

我一直在关注服务器端 JavaScript 的最新发展——尤其是 Node.js——并想知道是否有可能使用这种方法来开发 Google App Engine 网络应用程序——与 Python 或 Java 分开或结合使用?

采纳答案by Robert Kluin

node.js uses an event-loop model which is not really a good fit with the current App Engine design.

node.js 使用事件循环模型,这与当前的 App Engine 设计不太匹配。

However, there are several projects that bring JavaScript to App Engine. Check out App Engine issue 35to read about some of the solutions. The highlights are: Rhino, Rhino For Webapps, if you like Python check out AppengineJS. I have also heard that RingoJSmight be worth looking into.

但是,有几个项目将 JavaScript 引入 App Engine。查看 App Engine问题 35以了解一些解决方案。亮点是:RhinoRhino For Webapps,如果你喜欢 Python 看看AppengineJS。我还听说RingoJS可能值得研究。

回答by Luca Matteis

Also you might want to check out ApeJS. A little framework I wrote similar to AppengineJS but more minimalist.

你也可能想看看 ApeJS。我写的一个类似于 AppengineJS 但更简约的小框架。

http://lmatteis.github.com/apejs/

http://lmatteis.github.com/apejs/

回答by fullstacklife

Tornado can run on app engine and is similar to node.js but using python, and has a nice yield approach too. But there are limitations with tornado's use on app engine that might defeat the object of using it for your project. See tornado on github for more info I use both but node.js with connect middelware and express.js to make node easier to use for simple web apps.

Tornado 可以在应用引擎上运行,与 node.js 类似,但使用 python,并且也有一个很好的收益方法。但是 Tornado 在应用程序引擎上的使用存在一些限制,可能会破坏将其用于您的项目的目标。有关更多信息,请参阅 github 上的 Tornado,我同时使用 node.js 和 connect middelware 和 express.js,以使 node 更易于用于简单的 Web 应用程序。

回答by tuned

Now the best option is to use Google Compute Engine and Datastore > link here

现在最好的选择是使用 Google Compute Engine 和 Datastore >链接在这里

You can use Google Compute Engine to host your node.jsapp and use google-api-nodejs-clientto connect to the datastore:

您可以使用 Google Compute Engine 来托管您的node.js应用程序并使用google-api-nodejs-client连接到数据存储:

  1. You need to create a project in Google API Console, and activate Compute Engineservice for it
  2. You have to enable Google Cloud DatastoreAPI (see link above)
  3. You need to set your dataset-id (same identifier as your Google Cloud Project ID).
  4. You need to be connected to a Compute Engine instance with both the datastore and userinfo.email scopes (node.js support for certificate-based service accounts is not yet implemented).
  5. You need a working node.js environment in your Compute Engine machine.
  6. npm install google-api-nodejs-client in your administration command-line tool
  1. 您需要在Google API Console 中创建一个项目,并为其激活Compute Engine服务
  2. 您必须启用 Google Cloud DatastoreAPI(请参阅上面的链接)
  3. 您需要设置您的数据集 ID(与您的 Google Cloud 项目 ID 相同的标识符)。
  4. 您需要连接到同时具有 datastore 和 userinfo.email 作用域的 Compute Engine 实例(node.js 对基于证书的服务帐户的支持尚未实现)。
  5. 您需要在您的 Compute Engine 机器中有一个有效的 node.js 环境。
  6. npm install google-api-nodejs-client 在您的管理命令行工具中

And you should be ready to go

你应该准备好了

回答by wires

While not the same as pureapp engine (eg. manual scaling and currently in alphastatus), this is now possible using Appengine Managed VMs.

虽然与应用引擎不同(例如,手动缩放和目前处于alpha状态),但现在可以使用Appengine Managed VMs

See:

看:

They also announced a Node.JS library for working with the google cloud platform.

他们还宣布了一个 Node.JS 库,用于与谷歌云平台合作