• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

GoogleCloudPlatform/google-cloud-node-todos: TodoMVC backend using gcloud-node

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

GoogleCloudPlatform/google-cloud-node-todos

开源软件地址(OpenSource Url):

https://github.com/GoogleCloudPlatform/google-cloud-node-todos

开源编程语言(OpenSource Language):

JavaScript 99.0%

开源软件介绍(OpenSource Introduction):

google-cloud-node-todos

TodoMVC backend using google-cloud-node.

Prerequisites

  1. Create a new cloud project on console.developers.google.com

  2. Enable the Google Cloud Datastore API. For more information about the Cloud Datastore, see here.

  3. Create a new service account and copy the JSON credentials to key.json

  4. Export your project id:

    $ export PROJECT_ID=<project id>

Running

Locally

# Set your default Dataset
$ export DATASET_ID=$PROJECT_ID

# Install the dependencies
$ npm install

# Start the server
$ npm start

Docker

# Check that Docker is running
$ boot2docker up
$ $(boot2docker shellinit)

# Build your Docker image
$ docker build -t app .

# Start a new Docker container
$ docker run -e DATASET_ID=$PROJECT_ID -p 8080:8080 app

# Test the app
$ curl -X GET http://$(boot2docker ip):8080

Managed VMs

# Get gcloud
$ curl https://sdk.cloud.google.com | bash

# Authorize gcloud and set your default project
$ gcloud auth login
$ gcloud config set project $PROJECT_ID

# Get App Engine component
$ gcloud components update app

# Check that Docker is running
$ boot2docker up
$ $(boot2docker shellinit)

# Download the Node.js Docker image
$ docker pull google/nodejs-runtime

# Run the app locally
$ npm start
$ curl -X GET http://localhost:8080

# Deploy the app to production
$ gcloud app deploy
$ curl -X GET http://$PROJECT_ID.appspot.com

Command Line

This sample can also be run from the command line:

$ npm link
$ datastore-todos

Resources




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap