-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (19 loc) · 645 Bytes
/
app.js
File metadata and controls
25 lines (19 loc) · 645 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
var express = require('express')
, app = express.createServer();
app.configure(function(){
//To use .html as file extension for templates uncomment these 2 lines
//as well as switch the filetype of index.hbs below
//app.set('view engine', 'html');
//app.engine('html', require('hbs').__express); -
});
app.get('/', function(req, res){
var data = {
title: "Node + Handlebars",
body: "Hello World!"
}
res.render('index.hbs', data);
//Tell Express to render views/index.html
//res.render('index.html', data);
});
app.listen(1337);
console.log('Server running at http://127.0.0.1:1337/');