Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ejangi/1c64ed4b70fd696c5d6735bf76978af8 to your computer and use it in GitHub Desktop.
Save ejangi/1c64ed4b70fd696c5d6735bf76978af8 to your computer and use it in GitHub Desktop.
const functions = require('@google-cloud/functions-framework');
const express = require('express');
const app = express();
// GET /myFunction
app.get('/', async (req, res) => {
res.status(200).send('Default route');
});
// GET /myFunction/other
app.get('/other', async (req, res) => {
res.status(200).send('Other route!');
});
/* HTTP Cloud Function.
*
* @param {Object} req Cloud Function request context.
* @param {Object} res Cloud Function response context.
*/
functions.http('myFunction', app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment