-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
31 lines (26 loc) · 959 Bytes
/
server.js
File metadata and controls
31 lines (26 loc) · 959 Bytes
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
const express = require("express");
const path = require("path");
const firebase = require("firebase");
const axios = require("axios");
const port = process.env.PORT || 8080;
const app = express();
app.use(express.static(__dirname));
// var config = {
// apiKey: "AIzaSyBikhUuxvdby-jvrW45ozvAMHbjN7W8_EQ",
// authDomain: "project-reconnect.firebaseapp.com",
// databaseURL: "https://project-reconnect.firebaseio.com",
// projectId: "project-reconnect",
// storageBucket: "project-reconnect.appspot.com",
// messagingSenderId: "412974593069"
// };
// firebase.initializeApp(config);
// firebase.database().ref(`/invitations`).on('value', snapshot => {
// const usersRef = firebase.database().ref('users');
// const data = snapshot.val();
// // sendEmail();
// })
app.get("*", (req, res) => {
res.sendFile(path.resolve(__dirname, "index.html"));
});
app.listen(port);
console.log("Server started at port " + port);