0.0.2 • Published 5 years ago

google-cloud-function-http-server v0.0.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
5 years ago

google cloud function http server

Call your http server stack code using an in memory http listener. No sockets needed.

js-standard-style build status downloads Greenkeeper badge

server.js

require('http').createServer((req, res) => {
  if (req.url === '/hello') return res.end('world')
})
.listen(5000)

google-cloud-function.js

exports.proxy = require('google-cloud-function-http-server')
require('./index.js')

serverless.yml

service: test
provider:
  name: google
  runtime: nodejs8
  project: x
  credentials: ~/.gcloud/keyfile.json

plugins:
  - serverless-google-cloudfunctions

functions:
  proxy:
    environment:
      SERVER_PORT: "5000"
    handler: proxy
    events:
      - http: path

license

Apache License, Version 2.0