-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
30 lines (24 loc) · 854 Bytes
/
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
const express = require('express')
// const bodyParser = require('body-parser')
const app = express()
const twitterAPI = require('./controllers/twitterAPI')
// parse incoming requests
// app.use(bodyParser.json())
// app.use(bodyParser.urlencoded({ extended: false }))
// serve static files from /public
app.use(express.static(__dirname + '/public'))
// set the port of our application
// process.env.PORT lets the port be set by Heroku
// from https://scotch.io/tutorials/how-to-deploy-a-node-js-app-to-heroku
const port = process.env.PORT || 3000
twitterAPI.connect()
// view engine setup
app.set('view engine', 'pug')
app.set('views', __dirname + '/views')
// include routes
var routes = require('./routes/index')
app.use('/', routes)
// listen on port 3000
app.listen(port, function () {
console.log('Express app listening on port 3000')
});