merge index-page.coffee to panel.coffee

This commit is contained in:
jysperm
2014-03-11 05:15:00 +08:00
parent 158029a169
commit af71fc3ad5
3 changed files with 5 additions and 6 deletions

View File

@@ -1,4 +0,0 @@
module.exports =
get:
'/': (req, res) ->
res.redirect '/panel/'

View File

@@ -1,12 +1,12 @@
exports.bind = (app) ->
for item in ['index-page', 'user', 'panel']
for item in ['user', 'panel']
apiModule = require('./' + item)
generateUrl = (name) ->
if name[0] == '/'
return name
else
return "/#{item}/#{name}"
return "/#{item}/#{name}/"
for name, controller of apiModule.get
app.get generateUrl(name), controller

View File

@@ -1,4 +1,7 @@
module.exports =
get:
'/': (req, res) ->
res.redirect '/panel/'
'/panel/': (req, res) ->
res.render 'panel'