google-cloud-function-http-server

0.0.2 • Public • Published

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

Package Sidebar

Install

npm i google-cloud-function-http-server

Weekly Downloads

2

Version

0.0.2

License

Apache-2.0

Unpacked Size

2.29 kB

Total Files

3

Last publish

Collaborators

  • jameskyburz