-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
46 lines (31 loc) · 1.07 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// const express = require('express');
// const connectDB = require('./config/db');
// const cors = require('cors');
// // routes
// const movies = require('./routes/api/movies');
// const app = express();
// // connect database
// connectDB();
// // cors
// app.use(cors({ origin: true, credentials: true }));
// // Init Middleware
// app.use(express.json({ extended: false }));
// app.get('/', (req, res) => res.send('Hello world!'));
// // use Routes
// app.use('/api/movies', movies);
// const port = process.env.PORT || 8000;
// app.listen(port, () => console.log(`Server running on port ${port}`));
// const { initializeApp, applicationDefault, cert } = require('firebase-admin/app');
// const { getFirestore, Timestamp, FieldValue } = require('firebase-admin/firestore');
// const serviceAccount = require('key.json');
// initializeApp({
// credential: cert(serviceAccount)
// });
// const db = getFirestore();
// const docRef = db.collection('users').doc('alovelace');
// await docRef.set({
// first: 'Ada',
// last: 'Lovelace',
// born: 1815
// });
//import libraries