-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
43 lines (31 loc) · 1.12 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
const express = require('express');
const app = express();
const path = require('path');
const http = require('http').Server(app);
const bodyParser = require('body-parser');
const admin = require("firebase-admin");
const config = require('./firebase-config.json');
const serviceAccount = require("./firebase-admin.json");
const { twitter } = require('./twitter');
const { home, assistant, liquidgalaxy, tweet, configuration, physicalweb } = require('./routes');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', home);
app.use('/', configuration);
app.use('/', liquidgalaxy);
app.use('/', assistant);
app.use('/', tweet);
app.use('/', physicalweb);
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: config.databaseURL
});
// Tweet the update every 24 hours
setInterval(twitter.tweetUpdate, 86400000);
http.listen(process.env.PORT || 3000, function(){
console.log('listening on *:3000');
});
module.exports = app;