Added firebase functions

This commit is contained in:
Zakary Timson 2018-07-17 21:03:33 -04:00
parent 8badbd4e5f
commit 24c057738e
5 changed files with 2738 additions and 0 deletions

View File

@ -12,5 +12,8 @@
"destination": "/index.html"
}
]
},
"functions": {
"predeploy": "npm --prefix \"$RESOURCE_DIR\" run build"
}
}

20
functions/package.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "functions",
"scripts": {
"build": "tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "~5.12.1",
"firebase-functions": "^1.0.3"
},
"devDependencies": {
"typescript": "^2.5.3"
},
"private": true
}

5
functions/src/index.ts Normal file
View File

@ -0,0 +1,5 @@
import * as functions from 'firebase-functions';
export const helloWorld = functions.https.onRequest((request, response) => {
response.send('Hello from Firebase!');
});

14
functions/tsconfig.json Normal file
View File

@ -0,0 +1,14 @@
{
"compilerOptions": {
"lib": ["es6"],
"module": "commonjs",
"noImplicitReturns": true,
"outDir": "lib",
"sourceMap": true,
"target": "es6"
},
"compileOnSave": true,
"include": [
"src"
]
}

2696
functions/yarn.lock Normal file

File diff suppressed because it is too large Load Diff