Last active
October 9, 2017 13:51
-
-
Save jthegedus/d2174b51a83ca1e3e4153fe3a9ca768c to your computer and use it in GitHub Desktop.
Cloud Functions for Firebase - Express example 2/3 - using middleware
This file contains hidden or 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("firebase-functions") | |
const cors = require("cors") | |
const express = require("express") | |
/* Express with CORS */ | |
const app2 = express() | |
app2.use(cors({ origin: true })) | |
app2.get("*", (request, response) => { | |
response.send("Hello from Express on Firebase with CORS!") | |
}) | |
const api2 = functions.https.onRequest(app2) | |
module.exports = { | |
api2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment