Skip to content

Commit

Permalink
Read index.html as template
Browse files Browse the repository at this point in the history
  • Loading branch information
jeka-kiselyov committed Jul 5, 2013
1 parent 70aa9c1 commit 39814c9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions web.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
var express = require('express');

var fs = require('fs');
var app = express.createServer(express.logger());

var tpl_file = 'index.html';

app.get('/', function(request, response) {
response.send('Hello World2!');

var tpl = fs.readFileSync(tpl_file).toString();
response.send(tpl);
});

var port = process.env.PORT || 5000;
Expand Down

0 comments on commit 39814c9

Please sign in to comment.