https://github.com/jameskyburz/google-cloud-function-http-server
run your http server as a google cloud function
https://github.com/jameskyburz/google-cloud-function-http-server
faas google-cloud-function http http-server https in-memory-http-server lambda nodejs proxy
Last synced: 10 months ago
JSON representation
run your http server as a google cloud function
- Host: GitHub
- URL: https://github.com/jameskyburz/google-cloud-function-http-server
- Owner: JamesKyburz
- Created: 2018-11-23T15:01:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-20T04:02:55.000Z (almost 6 years ago)
- Last Synced: 2025-03-13T07:07:15.706Z (11 months ago)
- Topics: faas, google-cloud-function, http, http-server, https, in-memory-http-server, lambda, nodejs, proxy
- Language: JavaScript
- Homepage: https://github.com/jameskyburz/google-cloud-function-http-server
- Size: 499 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# google cloud function http server
Call your http server stack code using an in memory http listener. No sockets needed.
[](https://github.com/feross/standard)
[](https://travis-ci.org/JamesKyburz/google-cloud-function-http-server)
[](https://npmjs.org/package/google-cloud-function-http-server)
[](https://greenkeeper.io/)
## index.js
```javascript
require('http').createServer((req, res) => {
if (req.url === '/hello') return res.end('world')
})
.listen(5000)
```
## proxy.js
```javascript
exports.http = require('google-cloud-function-http-server')
require('./index.js')
```
## serverless.yml
```yaml
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](LICENSE)