forked from rsandagon/sample-angular-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (19 loc) · 620 Bytes
/
app.js
File metadata and controls
26 lines (19 loc) · 620 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
var express = require('express');
var path = require('path');
var index = require('./routes/index');
var tweets = require('./routes/tweets');
var app = express();
// serve static assets from the public directory
app.use(express.static(path.join(__dirname, 'public')));
// look for view html in the views directory
app.set('views', path.join(__dirname, 'views'));
// use ejs to render
app.set('view engine', 'ejs');
// setup routes
app.use('/', index);
app.use('/tweets', tweets);
module.exports = app;
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log('Listening on ' + port);
});