Skip to content

Commit

Permalink
enable to pass loaded module into context.include
Browse files Browse the repository at this point in the history
for supporting nest include like this:
@include = ->
  @include require './a'
  @include require './b'
  • Loading branch information
imzshh committed Mar 1, 2012
1 parent 35deced commit aa34da7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zappa.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ zappa.app = (func) ->
v.apply(context, [context])

context.include = (p) ->
sub = require path.join(context.root, p)
sub = if typeof p == 'string' then require path.join(context.root, p) else p
sub.include.apply(context, [context])

# Register a route with express.
Expand Down

0 comments on commit aa34da7

Please sign in to comment.