-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
executable file
·30 lines (22 loc) · 826 Bytes
/
app.js
File metadata and controls
executable file
·30 lines (22 loc) · 826 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
26
27
28
29
30
var express = require('express');
var http = require('http');
var path = require('path');
var handlebars = require('express-handlebars'), hbs;
var app = express();
app.set('port', 3000);
app.set('views', path.join(__dirname, 'views'));
/* express-handlebars - https://github.com/ericf/express-handlebars
A Handlebars view engine for Express. */
hbs = handlebars.create({
defaultLayout: 'main'
});
app.engine('handlebars', hbs.engine);
app.set('view engine', 'handlebars');
app.use(express.static(path.join(__dirname, 'static')));
// stylesheet
app.use("/styles", express.static(__dirname + "/styles"));
// send app to router
require('./router')(app);
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});