Node.js and Google Cloud

24
javascript and google cloud

description

why and how use node.js at google cloud platform

Transcript of Node.js and Google Cloud

Page 1: Node.js and Google Cloud

javascript and google cloud

Page 2: Node.js and Google Cloud

Paulo Pires paulopires.me

Page 3: Node.js and Google Cloud

how google cloud work?

Page 4: Node.js and Google Cloud
Page 5: Node.js and Google Cloud

PaaS

Page 6: Node.js and Google Cloud

go python php java custom runtimes

Page 7: Node.js and Google Cloud

custom runtimes

Page 8: Node.js and Google Cloud
Page 9: Node.js and Google Cloud

you need 4 files

Page 10: Node.js and Google Cloud

app.yaml Dockerfile server.js package.json

Page 11: Node.js and Google Cloud

app.yaml

version: 1 runtime: custom vm: true api_version: 1

manual_scaling: instances: 1

handlers: ...

Page 12: Node.js and Google Cloud

Dockerfile

FROM google/nodejs-runtime

Page 13: Node.js and Google Cloud

server.js var appengine = require('appengine'); var express = require('express');

var app = express();

app.use(appengine.middleware.base);

app.get('/_ah/health', function(req, res) { res.set('Content-Type', 'text/plain'); res.send(200, 'ok'); }); app.listen(8080, '0.0.0.0'); console.log('Listening on port 8080');

Page 14: Node.js and Google Cloud

package.json { "name": "quickstart", "description": "Appengine node.js project", "version": "0.0.1", "dependencies": { "express": "4.x", "appengine" : "git://github.com/GoogleCloudPlatform/appengine-nodejs.git" } }

Page 15: Node.js and Google Cloud

Page 16: Node.js and Google Cloud

$ gcloud preview app run . $ gcloud --verbosity debug preview app run . $ gcloud --project YOUR-PROJECT preview app deploy .

deploy

Page 17: Node.js and Google Cloud

Page 18: Node.js and Google Cloud

we have other option

Page 19: Node.js and Google Cloud
Page 20: Node.js and Google Cloud

IaaS

Page 21: Node.js and Google Cloud

storage compute dns api's big query

Page 22: Node.js and Google Cloud

to use with node.js

bit.ly/node-google

Page 23: Node.js and Google Cloud

Page 24: Node.js and Google Cloud

vlw♥