diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 0000000..b87b610 --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "noteups-web-original-backend" + } +} diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..49218a3 --- /dev/null +++ b/firebase.json @@ -0,0 +1,35 @@ +{ + "functions": [ + { + "source": "functions", + "codebase": "default", + "ignore": [ + "node_modules", + ".git", + "firebase-debug.log", + "firebase-debug.*.log" + ], + "predeploy": [ + "npm --prefix \"$RESOURCE_DIR\" run lint" + ] + } + ], + "database": { + "rules": "database.rules.json" + }, + "firestore": { + "rules": "firestore.rules", + "indexes": "firestore.indexes.json" + }, + "hosting": { + "public": "public", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ] + }, + "storage": { + "rules": "storage.rules" + } +} diff --git a/functions/index.js b/functions/index.js index 0d3ca7f..e81477f 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1,9 +1,19 @@ -const functions = require("firebase-functions"); +/** + * Import function triggers from their respective submodules: + * + * const {onCall} = require("firebase-functions/v2/https"); + * const {onDocumentWritten} = require("firebase-functions/v2/firestore"); + * + * See a full list of supported triggers at https://firebase.google.com/docs/functions + */ -// // Create and deploy your first functions -// // https://firebase.google.com/docs/functions/get-started -// -// exports.helloWorld = functions.https.onRequest((request, response) => { -// functions.logger.info("Hello logs!", {structuredData: true}); +const {onRequest} = require("firebase-functions/v2/https"); +const logger = require("firebase-functions/logger"); + +// Create and deploy your first functions +// https://firebase.google.com/docs/functions/get-started + +// exports.helloWorld = onRequest((request, response) => { +// logger.info("Hello logs!", {structuredData: true}); // response.send("Hello from Firebase!"); // }); diff --git a/functions/package.json b/functions/package.json index 1e606ae..a88bc5e 100644 --- a/functions/package.json +++ b/functions/package.json @@ -10,17 +10,17 @@ "logs": "firebase functions:log" }, "engines": { - "node": "16" + "node": "18" }, "main": "index.js", "dependencies": { - "firebase-admin": "^11.5.0", - "firebase-functions": "^4.2.0" + "firebase-admin": "^11.8.0", + "firebase-functions": "^4.3.1" }, "devDependencies": { "eslint": "^8.15.0", "eslint-config-google": "^0.14.0", - "firebase-functions-test": "^3.0.0" + "firebase-functions-test": "^3.1.0" }, "private": true } diff --git a/public/index.html b/public/index.html index cb94d49..ad41d9d 100644 --- a/public/index.html +++ b/public/index.html @@ -6,17 +6,17 @@ Welcome to Firebase Hosting - + - - - - - - - - - + + + + + + + + +