1
|
var express = require('express');
|
1
|
var express = require('express');
|
2
|
var path = require('path');
|
2
|
var path = require('path');
|
3
|
-var ejs = require('hbs');
|
3
|
+var hbs = require('hbs');
|
4
|
var favicon = require('serve-favicon');
|
4
|
var favicon = require('serve-favicon');
|
5
|
var logger = require('morgan');
|
5
|
var logger = require('morgan');
|
6
|
var cookieParser = require('cookie-parser');
|
6
|
var cookieParser = require('cookie-parser');
|
|
@@ -9,17 +9,17 @@ var init=require('YJS'); |
|
@@ -9,17 +9,17 @@ var init=require('YJS'); |
9
|
var routes = require('./routes/index');
|
9
|
var routes = require('./routes/index');
|
10
|
var users = require('./routes/users');
|
10
|
var users = require('./routes/users');
|
11
|
var pjax = require('express-pjax');
|
11
|
var pjax = require('express-pjax');
|
12
|
-var partials = require('express-partials');
|
12
|
+//var partials = require('express-partials');
|
13
|
var app = express();
|
13
|
var app = express();
|
14
|
|
14
|
|
15
|
// view engine setup
|
15
|
// view engine setup
|
16
|
app.set('views', path.join(__dirname, 'views'));
|
16
|
app.set('views', path.join(__dirname, 'views'));
|
17
|
-app.engine('html', ejs.__express);
|
17
|
+app.engine('html', hbs.__express);
|
18
|
app.set('view engine', 'html');
|
18
|
app.set('view engine', 'html');
|
19
|
|
19
|
|
20
|
// uncomment after placing your favicon in /public
|
20
|
// uncomment after placing your favicon in /public
|
21
|
app.use(favicon(__dirname + '/public/favicon.ico'));
|
21
|
app.use(favicon(__dirname + '/public/favicon.ico'));
|
22
|
-
|
22
|
+hbs.registerPartials(__dirname + '/views/partials');
|
23
|
app.use(bodyParser.json());
|
23
|
app.use(bodyParser.json());
|
24
|
|
24
|
|
25
|
app.use(bodyParser.urlencoded({ extended: false }));
|
25
|
app.use(bodyParser.urlencoded({ extended: false }));
|