Skip to content

Instantly share code, notes, and snippets.

@hossain-khan
Created March 13, 2019 03:20
Show Gist options
  • Save hossain-khan/efac2c76f2dbbe0d50a646ede49dbd7b to your computer and use it in GitHub Desktop.
Save hossain-khan/efac2c76f2dbbe0d50a646ede49dbd7b to your computer and use it in GitHub Desktop.
Firebase and express barebone.
'use strict';
// [START import]
const functions = require('firebase-functions');
const express = require('express');
const app = express();
// [END import]
// [START middleware]
const cors = require('cors')({origin: true});
app.use(cors);
// [END middleware]
// Define the Firebase function that will act as Express application
// Note: This `api` must match with `/firebase.json` rewrites rule.
exports.api = functions.https.onRequest(app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment