google-cloud-function-http-server
v0.0.2
Published
run http servers as google cloud functions
Downloads
19
Maintainers
Readme
google cloud function http server
Call your http server stack code using an in memory http listener. No sockets needed.
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