Last active
November 4, 2019 16:16
-
-
Save grant/a49aecc1d9a7dc45062657b276a695ce to your computer and use it in GitHub Desktop.
Pizza App Routes
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 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