     #    ----------------------------
     #    
     app.get "/blog", (req, res) ->
-      check = 0
-      categories = undefined
-      tags = undefined
-      entries = undefined
-      eventflow = new eventEmitter()
-      blog.getCategories (err, cat) ->
-        categories = cat
-        check++
-        eventflow.emit "render"  if check is 3
-
-      blog.getEntries 5, 0, (err, ent) ->
-        entries = ent
-        check++
-        eventflow.emit "render"  if check is 3
-
-      blog.getTags (err, tag) ->
-        tags = tag
-        check++
-        eventflow.emit "render"  if check is 3
-
-      eventflow.on "render", ->
-        res.render "blog",
-          entries: entries
-          categories: categories
-          tags: tags
-          config: config
-          request: req
+      res.render "blog",
 
     #
     #     `Get pagination blog posts`

user = require("../lib/user")
blog = require("../lib/blog")
config = require("../config")
sha1 = require("sha1")
eventEmitter = require("events").EventEmitter
checkAuth = (req, res, next) ->
  actualTimestamp = undefined
  actualTimestamp = (new Date()).getTime()
  unless req.session.logged_in is true and actualTimestamp < req.session.expirationDate
    res.redirect "/login"
  else
    next()

module.exports =
  blog: (app) ->

    #     `Update blog post`
    #    ----------------------------
    #    
    app.put "/blog/post/:id", (req, res) ->
      blog.editEntry req.params.id, req.body, (err, data) ->
        unless err
          res.json result: "OK"
