forked from heroku/node-js-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.js
30 lines (25 loc) · 777 Bytes
/
web.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
var express = require('express');
var app = express.createServer(express.logger());
app.get('/', function(request, response) {
var fs = require('fs');
var content = fs.readFileSync('index.html');
response.send(content.toString('utf-8'));
//response.send('hellooo');
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});
/*
var express = require('express');
var app = express.createServer(express.logger());
app.get('/', function(request, response) {
var fs = require('fs');
var buf = new Buffer(fs.readFileSync('index.html'), 'utf-8');
response.send(buf.toString());
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});
*/