Skip to content

Instantly share code, notes, and snippets.

@grant
Last active November 4, 2019 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/a49aecc1d9a7dc45062657b276a695ce to your computer and use it in GitHub Desktop.
Save grant/a49aecc1d9a7dc45062657b276a695ce to your computer and use it in GitHub Desktop.
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