- /news/:id router

This commit is contained in:
tmshv committed 2016-03-18 01:52:23 +03:00
1 parent cc4a11c717
commit f5fbd2888d
1 file changed
-13
-13
View File
@@ -64,17 +64,4 @@ export default function (app) {
.then(i => i.sort(sortNewsByDate));
}
})));
app.use(route.get('/news/:id', accepts({
'text/html': index(),
'text/plain': index(),
'application/json': function *(id) {
let item = yield c('timeline').findOne({uri: id});
if (item) {
this.body = item;
} else {
this.status = 404;
}
}
})));
};