Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
8 years ago
Commit
1018d8ac154a8e7ec6a84159883c90c36b550cb2
1 parent
239d4c90
tpl
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
7 deletions
apps/help/controllers/index.js
apps/help/index.js
apps/help/router.js
apps/help/views/action/help/index.hbs
dispatch.js
apps/help/controllers/index.js
0 → 100644
View file @
1018d8a
'use strict'
;
const
mRoot
=
'../models'
;
const
index
=
(
req
,
res
,
next
)
=>
{
res
.
render
(
'help/index'
,
{});
};
module
.
exports
=
{
index
};
\ No newline at end of file
...
...
apps/help/index.js
View file @
1018d8a
...
...
@@ -5,8 +5,7 @@
*/
var
express
=
require
(
'express'
),
path
=
require
(
'path'
),
hbs
=
require
(
'express-handlebars'
);
path
=
require
(
'path'
);
var
app
=
express
();
...
...
@@ -18,12 +17,12 @@ app.on('mount', function(parent) {
Object
.
assign
(
app
.
locals
,
parent
.
locals
);
});
app
.
set
(
'views'
,
path
.
join
(
__dirname
,
'views/action'
));
app
.
engine
(
'.hbs'
,
hbs
({
app
.
use
(
global
.
yoho
.
hbs
({
extname
:
'.hbs'
,
defaultLayout
:
'layout'
,
layoutsDir
:
doraemon
,
partialsDir
:
[
path
.
join
(
__dirname
,
'views/partial'
),
`
$
{
doraemon
}
/partial`]
,
partialsDir
:
[
path
.
join
(
__dirname
,
'views/partial'
)],
views
:
path
.
join
(
__dirname
,
'views/action'
),
helpers
:
global
.
yoho
.
helpers
}));
...
...
apps/help/router.js
View file @
1018d8a
...
...
@@ -7,8 +7,10 @@
'use strict'
;
const
router
=
require
(
'express'
).
Router
();
// eslint-disable-line
//
const cRoot = './controllers';
const
cRoot
=
'./controllers'
;
// Your controller here
const
help
=
require
(
`
$
{
cRoot
}
/index`
)
;
router
.
get
(
'/help'
,
help
.
index
);
module
.
exports
=
router
;
...
...
apps/help/views/action/help/index.hbs
0 → 100644
View file @
1018d8a
index.hbs
...
...
dispatch.js
View file @
1018d8a
...
...
@@ -12,6 +12,7 @@ module.exports = app => {
// 业务模块
app
.
use
(
require
(
'./apps/channel'
));
// 频道页
app
.
use
(
require
(
'./apps/activity'
));
// 专题活动等活动页面
app
.
use
(
require
(
'./apps/help'
));
// 帮助中心
app
.
use
(
'/product'
,
require
(
'./apps/product'
));
// 商品相关页面
app
.
use
(
require
(
'./apps/passport'
));
// 登录注册
app
.
use
(
'/home'
,
require
(
'./apps/home'
));
// 会员中心
...
...
Please
register
or
login
to post a comment