From 083e5c506b8d36351b12dd87d43162416484a125 Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 10 Dec 2021 12:10:30 -0600 Subject: [PATCH] initial commit --- .firebaserc | 5 +++++ firebase.json | 5 +++++ functions/.gitignore | 13 +++++++++++++ functions/package.json | 24 ++++++++++++++++++++++++ functions/src/index.ts | 6 ++++++ functions/tsconfig.json | 15 +++++++++++++++ 6 files changed, 68 insertions(+) create mode 100644 .firebaserc create mode 100644 firebase.json create mode 100644 functions/.gitignore create mode 100644 functions/package.json create mode 100644 functions/src/index.ts create mode 100644 functions/tsconfig.json diff --git a/.firebaserc b/.firebaserc new file mode 100644 index 00000000..7594f4c6 --- /dev/null +++ b/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "mantic-markets" + } +} diff --git a/firebase.json b/firebase.json new file mode 100644 index 00000000..060c76ca --- /dev/null +++ b/firebase.json @@ -0,0 +1,5 @@ +{ + "functions": { + "predeploy": "npm --prefix \"$RESOURCE_DIR\" run build" + } +} diff --git a/functions/.gitignore b/functions/.gitignore new file mode 100644 index 00000000..e0ba0181 --- /dev/null +++ b/functions/.gitignore @@ -0,0 +1,13 @@ +# Compiled JavaScript files +lib/**/*.js +lib/**/*.js.map + +# TypeScript v1 declaration files +typings/ + +# Node.js dependency directory +node_modules/ + +package-lock.json +ui-debug.log +firebase-debug.log \ No newline at end of file diff --git a/functions/package.json b/functions/package.json new file mode 100644 index 00000000..2738eb80 --- /dev/null +++ b/functions/package.json @@ -0,0 +1,24 @@ +{ + "name": "functions", + "scripts": { + "build": "tsc", + "serve": "npm run build && firebase emulators:start --only functions", + "shell": "npm run build && firebase functions:shell", + "start": "npm run shell", + "deploy": "firebase deploy --only functions", + "logs": "firebase functions:log" + }, + "engines": { + "node": "14" + }, + "main": "lib/index.js", + "dependencies": { + "firebase-admin": "9.8.0", + "firebase-functions": "3.14.1" + }, + "devDependencies": { + "firebase-functions-test": "0.2.0", + "typescript": "3.8.0" + }, + "private": true +} diff --git a/functions/src/index.ts b/functions/src/index.ts new file mode 100644 index 00000000..113a4f9e --- /dev/null +++ b/functions/src/index.ts @@ -0,0 +1,6 @@ +import * as functions from "firebase-functions" + +export const helloWorld = functions.https.onRequest((request, response) => { + functions.logger.info("Hello logs!", { structuredData: true }) + response.send("Hello from Firebase!") +}) diff --git a/functions/tsconfig.json b/functions/tsconfig.json new file mode 100644 index 00000000..7ce05d03 --- /dev/null +++ b/functions/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitReturns": true, + "noUnusedLocals": true, + "outDir": "lib", + "sourceMap": true, + "strict": true, + "target": "es2017" + }, + "compileOnSave": true, + "include": [ + "src" + ] +}