mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
style fix, put return up top
This commit is contained in:
parent
9c77cb959e
commit
fe05db1595
1 changed files with 5 additions and 5 deletions
|
|
@ -167,6 +167,11 @@ function handleRequest(req, res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function commentServer(context) {
|
function commentServer(context) {
|
||||||
|
return { get: getComments
|
||||||
|
, count: countComments
|
||||||
|
, post: postComment
|
||||||
|
}
|
||||||
|
|
||||||
function addComment(post, name, email, url, body, timestamp) {
|
function addComment(post, name, email, url, body, timestamp) {
|
||||||
var comments = context.db.get(post) || []
|
var comments = context.db.get(post) || []
|
||||||
comments.push({ id: comments.length + 1
|
comments.push({ id: comments.length + 1
|
||||||
|
|
@ -250,11 +255,6 @@ function commentServer(context) {
|
||||||
comments = context.db.get(post) || []
|
comments = context.db.get(post) || []
|
||||||
res.respond({count: comments.length})
|
res.respond({count: comments.length})
|
||||||
}
|
}
|
||||||
|
|
||||||
return { get: getComments
|
|
||||||
, count: countComments
|
|
||||||
, post: postComment
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function requestHandler(context) {
|
function requestHandler(context) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue