Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update route
  • Loading branch information
guo-yu committed Sep 25, 2013
1 parent f0267a5 commit c6bd81a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 34 deletions.
7 changes: 3 additions & 4 deletions app.js
Expand Up @@ -25,7 +25,6 @@ var Server = function(params) {
user = require('./routes/user'),
index = require('./routes/index'),
sign = require('./routes/sign'),
admin = require('./routes/admin'),
errhandler = require('./lib/error');

// all environments
Expand All @@ -48,8 +47,8 @@ var Server = function(params) {
})
}));
app.use(function(req, res, next) {
if (!res.locals.App) {
res.locals.App = self;
if (!res.locals.Server) {
res.locals.Server = self;
}
next();
});
Expand All @@ -72,7 +71,7 @@ var Server = function(params) {
app.get('/signout', sign.out);

// thread
app.get('/thread/new', sign.check, thread.new);
app.get('/submit', sign.check, thread.submit);
app.post('/thread/new', sign.checkJSON, thread.create);
app.get('/thread/list', sign.checkJSON, thread.ls);
app.get('/thread/:id', sign.passport, thread.read);
Expand Down
4 changes: 4 additions & 0 deletions model.js
Expand Up @@ -45,6 +45,10 @@ var threadModel = new Schema({
name: String,
content: String,
url: String,
topic: {
type: String,
default: 'normal'
},
score: {
type: Number,
default: 0
Expand Down
29 changes: 0 additions & 29 deletions routes/admin.js

This file was deleted.

2 changes: 1 addition & 1 deletion routes/thread.js
Expand Up @@ -24,7 +24,7 @@ exports.ls = function(req, res, next) {
}

// 新增话题页面
exports.new = function(req, res, next) {
exports.submit = function(req, res, next) {
// 需要添加识别默认板块的逻辑
if (req.query.bid) {
board.brief(req.query.bid, function(err, b) {
Expand Down

0 comments on commit c6bd81a

Please sign in to comment.