gcf-express-app

0.0.5 • Public • Published

gcf-express-app

gcf-express-app helps you run express apps on Google Cloud Functions (GCF) without Firebase!

CircleCI Coverage Status MIT License version

Example

Edit index.js:

const gcfExpressApp = require('gcf-express-app')
const express = require('express')
 
const app = express()
app.get('/', (req, res) => res.send('Yup. I\'m alive.'))
 
exports.testExpressApp = gcfExpressApp(app)

And then:

$ gcloud beta functions deploy testExpressApp --trigger-http

Test it:

$ curl https://<YOUR_PROJECT>.cloudfunctions.net/testExpressApp

Cleanup:

$ gcloud beta functions delete testExpressApp

The example directory is a ready-to-deploy sample function that uses gcf-express-app and deploys an express app on GCF.

Why

I simply wanted to run express apps on GCF without using Firebase functions.

Simply doing:

const app = express()
[...]
exports.testExpressApp = app

Actually works. But then there's a problem with a trailing slash.

License

MIT

Dependencies (0)

    Dev Dependencies (16)

    Package Sidebar

    Install

    npm i gcf-express-app

    Weekly Downloads

    1

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    4.77 kB

    Total Files

    4

    Last publish

    Collaborators

    • erezro
    • kedmi
    • olevy