Last active
March 8, 2018 20:06
-
-
Save danthegoodman1/922671943e4b1bba5a7dfad842daf566 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('firebase-functions'); | |
const cors = require("cors"); | |
const express = require("express"); | |
const path = require("path"); | |
const app = express(); | |
app.use(cors({ origin:true })); | |
app.use('/', express.static(path.join(__dirname,'views'))); | |
// create a directory called 'views' in the functions folder | |
// wisit the /widgets/ to get the index, and /widgets/otherfile.html to get the otherfile.html | |
app.get("/test", (req, res) => { | |
console.log("Sending a message to someone!!!") | |
res.send("It worked!"); | |
}); | |
exports.widgets = functions.https.onRequest(app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment