Skip to content

Commit

Permalink
read index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jul 12, 2013
1 parent d17d417 commit f5e969a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion web.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@


var express = require('express');

var app = express.createServer(express.logger());

app.get('/', function(request, response) {
response.send('Hello World 2!');
response.send(getMessage);
console.log("message:" + getMessage);
});

var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});

var fs = require('fs');
var getMessage = function(){
var data = fs.readFileSync("index.html");
var message = data.toString('utf-8');
return message;
};

0 comments on commit f5e969a

Please sign in to comment.