Created
April 17, 2024 03:26
-
-
Save jamesasu/a47d23cd92c96ce8c0d71c140ab8a18b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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