Skip to content

Commit

Permalink
firebase functions set up
Browse files Browse the repository at this point in the history
  • Loading branch information
Facundo Martinez authored and Facundo Martinez committed Feb 20, 2021
1 parent 631523c commit b366a4a
Show file tree
Hide file tree
Showing 9 changed files with 2,542 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "ecom-solo"
}
}
7 changes: 7 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
}
}
14 changes: 14 additions & 0 deletions functions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"google",
],
rules: {
quotes: ["error", "double"],
},
};
1 change: 1 addition & 0 deletions functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
14 changes: 14 additions & 0 deletions functions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const functions = require("firebase-functions");
const express = require("express");
const cors = require("cors");

const app = express();

app.use(cors({origin: true}));
app.use(express.json());

app.get("*", (req, res) => {
res.status(404).send("404, Not Found.");
});

exports.api = functions.https.onRequest(app);
Loading

0 comments on commit b366a4a

Please sign in to comment.