Skip to content

Instantly share code, notes, and snippets.

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 danthegoodman1/922671943e4b1bba5a7dfad842daf566 to your computer and use it in GitHub Desktop.
Save danthegoodman1/922671943e4b1bba5a7dfad842daf566 to your computer and use it in GitHub Desktop.
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