Skip to content

Instantly share code, notes, and snippets.

@grant grant/index.js
Last active Nov 4, 2019

What would you like to do?
Pizza App Routes
const express = require('express');
const app = express();
const routes = {
'/foo': (req, res) => res.send('This is a test.'),
Object.entries(routes).map(([route, func]) => app.use(route, func));
app.use('/', (req, res) => res.send(Object.keys(routes))); // default
// Export the Express app to the Functions Framework
exports.function = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.