lib/blog.js
function findBlogs (pRequest, pResponse) {

    var query       = pRequest.params.query,
        posts       = cache.get('posts') || {};

    var blogsToSend = [];

    for (var key in posts) {
        var post = new Post(posts[key]);
        if (post.containsQuery(query))
        {
            blogsToSend.push(posts[key]);
        }
    }
    return pResponse.status(201).send(blogsToSend).end();
}
function findBlogs (pRequest, pResponse) {

    var query       = pRequest.params.query,
        posts       = cache.get('posts') || {};

    var blogsToSend = [];

    for (var key in posts) {
        var post = new Post(posts[key]);
        if (post.containsQuery(query))
        {
            blogsToSend.push(posts[key]);
        }
    }
    return pResponse.status(201).send(blogsToSend).end();
}
function findBlogs ( pRequest , pResponse ) { var query = pRequest . params . query , posts = cache . get ( 'posts' ) || { } ; var blogsToSend = [ ] ; for ( var key in posts ) { var post = new Post ( posts [ key ] ) ; if ( post . containsQuery ( query ) ) { blogsToSend . push ( posts [ key ] ) ; } } return pResponse . status ( 201 ) . send ( blogsToSend ) . end ( ) ; }
This function finds blogs which matches given blog post title, tags and keywords with the query text
@param pRequest
@param pResponse
This function finds blogs which matches given blog post title tags and keywords with the query text