This repository was archived by the owner on Mar 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Expand file tree Collapse file tree 2 files changed +2
-25
lines changed Original file line number Diff line number Diff line change 11const express = require ( 'express' )
22const bodyParser = require ( 'body-parser' )
33const cors = require ( 'cors' )
4- const admin = require ( 'firebase-admin' )
54const functions = require ( 'firebase-functions' )
65
76const config = require ( './config' )
87const billings = require ( './billings' )
98const embed = require ( './embed' )
109const oembed = require ( './oembed' )
1110
12-
1311/* Start Express server */
1412const app = express ( )
1513app . use ( cors ( ) )
1614app . use ( bodyParser . json ( ) )
1715
18-
19- /*
20- If we want to run the server outside of firebase's function servers
21- we'll need a service account, to have the right authorization
22- to connect as admin to our firebase instance.
23-
24- const serviceAccount = require("./serviceAccountKey.json")
25- admin.initializeApp({
26- credential: admin.credential.cert(serviceAccount),
27- databaseURL: "https://radio4000-staging.firebaseio.com"
28- });
29- */
30-
31- /*
32- When used on firebase servers, we just need to pull the config
33- and run the server that way:
34- $ firebase serve --only functions
35- source: https://firebase.google.com/docs/functions/local-emulator
36- */
37-
38- admin . initializeApp ( functions . config ( ) . firebase )
39-
40-
4116/* Routes */
4217app . get ( '/' , function ( req , res ) {
4318 res . json ( {
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ const stripe = require('stripe')
55const config = require ( '../config' )
66const noEndpoint = require ( '../utils/no-endpoint' )
77
8+ admin . initializeApp ( functions . config ( ) . firebase )
9+
810const billings = express . Router ( )
911
1012let stripePrivateKey = functions . config ( ) . stripe . private_key
You can’t perform that action at this time.
0 commit comments