Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


@all for Express #40

Radagaisus opened this Issue · 9 comments

5 participants

@app.all '/api/v1/user/current/*', (req, res, next) ->
    if req.user then next()
    else res.end()

Just noticed there's no @all function. Should I write a pull request or is that intentional?


I always thought it was intentional.
FWIW I just looked at the Express 3.x doc and in the root (application) scope Zappa doesn't offer @app.(all|locals|render|routes).
What do others think about adding @all?

@shimaore shimaore referenced this issue from a commit
@shimaore shimaore Added links to Express References.
Triggered by #40 :)

+1 for adding @all

@shimaore shimaore referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@shimaore shimaore referenced this issue from a commit
@shimaore shimaore Added `@all` (#40) 998ba8e

Looks good. What about @param for app.param?



# Check if the user_id is a valid MongoDB ID
@param 'user_id', (req, res, next, user_id) ->
  if ~user_id.indexOf /^[0-9A-F]{24,24}$/i
    next("Invalid User ID")

@Radagaisus please test @param (see documentation above)


@shimaore I can't right now, I'm working with an older version of Zappa. I'll write tests in the weekend.


Hey, I've added all the tests here. There's no need to test different HTTP methods, just different routes. If you want another test for different HTTP methods I'll add it.


When it is going to be available with npm?

@datashaman datashaman referenced this issue from a commit in datashaman/zappajs
@datashaman datashaman Add test for all from Radagaisus #40 55a088d

This can be closed.

@shimaore shimaore closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.