Showing
10 changed files
with
40 additions
and
28 deletions
@@ -13,15 +13,6 @@ var express = require('express'), | @@ -13,15 +13,6 @@ var express = require('express'), | ||
13 | 13 | ||
14 | var app = express(); | 14 | var app = express(); |
15 | 15 | ||
16 | -// set view engin | ||
17 | -app.set('views', path.join(__dirname, 'app/views/action')); | ||
18 | -app.engine('.hbs', hbs({ | ||
19 | - extname: '.hbs', | ||
20 | - defaultLayout: 'layout', | ||
21 | - layoutsDir: 'app/views/', | ||
22 | - partialsDir: 'app/views/partial/', | ||
23 | - helpers: 'helpers' | ||
24 | -})); | ||
25 | app.set('view engine', '.hbs'); | 16 | app.set('view engine', '.hbs'); |
26 | 17 | ||
27 | app.use(bodyParser.json()); | 18 | app.use(bodyParser.json()); |
@@ -29,8 +20,8 @@ app.use(bodyParser.urlencoded({extended: false})); | @@ -29,8 +20,8 @@ app.use(bodyParser.urlencoded({extended: false})); | ||
29 | app.use(cookieParser()); | 20 | app.use(cookieParser()); |
30 | app.use(express.static(path.join(__dirname, 'public'))); | 21 | app.use(express.static(path.join(__dirname, 'public'))); |
31 | 22 | ||
32 | -// router | ||
33 | -app.use(require('./router')); | 23 | +// dispatcher |
24 | +require('./dispatch')(app); | ||
34 | 25 | ||
35 | // listener | 26 | // listener |
36 | app.listen(3000, function() { | 27 | app.listen(3000, function() { |
app/views/action/index.hbs
deleted
100644 → 0
1 | -hello hbs |
apps/READNE.md
0 → 100644
dispatch.js
0 → 100644
doraemon/README.md
0 → 100644
router.js
deleted
100644 → 0
-
Please register or login to post a comment