Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

index.js

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

proxy.js

exports.http = 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: http
    events:
      - http: path

license

Apache License, Version 2.0

Releases

Packages

Used by

Contributors

Languages