-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
54 lines (45 loc) · 1.63 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
54
var express = require('express'),
app = express(),
session = require('express-session'),
admin = require("firebase-admin"),
bodyParser = require("body-parser");
//0Configurations-------------------------------------------------------------->
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/m3sh-b7ea3-firebase-adminsdk-69vmv-ee19cdb948");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://m3sh-b7ea3.firebaseio.com"
});
//0Middleware------------------------------------------------------------------>
//0Routes---------------------------------------------------------------------->
var indexRoute = require('./routes/main/index'),
facebookRoute = require('./routes/apis/facebook'),
locationRoute = require('./routes/apis/location'),
modelRoute = require('./routes/3dmodel/3dmodel');
app.use(indexRoute);
app.use(facebookRoute);
app.use(locationRoute);
app.use(modelRoute);
var http = require("http");
setInterval(function() {
http.get("http://m3sh.herokuapp.com/");
console.log("pinged");
}, 30000);
app.get('*', function(request, response){
response.send(":(");
});
app.listen(process.env.PORT, process.env.IP, function(){
console.log("Server Started!");
});