0.0.5 • Published 10 years ago

peekinto v0.0.5

Weekly downloads
21
License
-
Repository
github
Last release
10 years ago

Peek into a request

app.peek.get '/users/:name/**', (req, res) ->
    res.locals.user = loaduser req.query.name

app.get '/users/:name/dashboard', (req, res) ->
    res.locals.latestprojects = getlatestprojects res.locals.user
    res.render 'dashboard'

What is the problem?

A web request can be thought of as a pipeline. To render a given request multiple modules may have contributed to the content. The output of each module may be a rendered template or the results of an intermediate query. To finish off all the content and values are collected and rendered into the destination template.

How peekinto solves this problem

  1. Peekinto adds an additional structure to the express application object called peek. This has the same verb registration methods - get, post, put, delete.
  2. Methods registered against these verbs are not expected to complete the request.
  3. Multiple methods can match the same request, each getting an opportunity to perform processing.
  4. After all peek methods are run the normal app.VERB methods are called.

Goals

  1. Simple
  2. Work with existing code
  3. Support UI composition
0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago