forked from heroku/node-js-sample
-
Notifications
You must be signed in to change notification settings - Fork 40
/
index.js
22 lines (14 loc) · 842 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var express = require('express')
var app = express()
app.set('port', (process.env.PORT || 8080))
//app.use(express.static(__dirname + '/public'))
//__dirname returns the directory that the currently executing script is in.
app.get('/', function(request, response) {
response.sendFile('public/index.html',{root:__dirname})
/* sends an entire HTTP response to the client,
including headers and content,
which is why you can only call once*/
})
app.listen(app.get('port'), function() {
console.log("Node app is running at :" + app.get('port'))
})