-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
53 lines (40 loc) · 1.5 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
47
48
49
50
51
52
53
var express = require('express'),
app = express(),
session = require('express-session'),
admin = require("firebase-admin"),
bodyParser = require("body-parser");
//Configurations-------------------------------------------------------------->
app.use(bodyParser.urlencoded({extended : true}));
app.use(express.static(__dirname));
app.use(express.static(__dirname + '/public'));
app.set('view engine', 'ejs');
app.use(session({
cookieName: 'session',
secret: "Secret Louis P3P",
resave: false,
saveUninitialized: false,
duration: 30 * 60 * 1000,
activeDuration: 5 * 60 * 1000,
secure : true
}));
var serviceAccount = require("./private/facebooksafetymesh-firebase-adminsdk-oohp3-98725d0686");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://facebooksafetymesh.firebaseio.com"
});
//****************************Azure Stuff
//Middleware------------------------------------------------------------------>
//Routes---------------------------------------------------------------------->
var facebook = require('./routes/facebook'),
maps = require('./routes/maps');
app.use(facebook);
app.use(maps);
//****************************
// var http = require("http");
// setInterval(function() {
// http.get("http://m3sh.herokuapp.com/");
// console.log("pinged");
// }, 30000);
app.listen(process.env.PORT, process.env.IP, function(){
console.log("Facebook REST API Server Started!");
});