-
Notifications
You must be signed in to change notification settings - Fork 14
/
main.js
31 lines (26 loc) · 834 Bytes
/
main.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
31
'use strict';
var express = require('express'),
middleware = require('./app/middleware');
var app = express(),
port = 8000;
app.set('port', port);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.static(__dirname + '/public'));
app.use(middleware.react({
header: {
yield: 'js-yield-header',
component: require('./public/js/components/header'),
contextKey: 'initialHeaderStr'
},
footer: {
yield: 'js-yield-footer',
component: require('./public/js/components/footer'),
contextKey: 'initialFooterStr'
}
}));
app.get('/', function(req, res) {
return res.renderComponent('autocomplete', {myCustomVar: 'Hey, I am a custom var from the server'});
});
app.listen(port);
console.log('HTTP server running at port ' + port);