Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

serverAfter not working.. #442

Closed
nikravi opened this Issue · 2 comments

2 participants

@nikravi

Hello

I'm playing with the serverAfter, my code doesn't seem to work

serverAfter: ({server}, next) ->
    server.get 'samplePage', (req, res, next) ->
        res.send 'page content'
        next()
    console.log server.routes

when I try to hit http://localhost:9778/samplePage I get 404
The console.log is saying that there is a "route" defined..
Thanks

@nikravi

My bad.. I missed the /:

serverAfter: ({server}, next) ->
    server.get '/samplePage', (req, res, next) ->
        res.send 'page content'
        next()

Sorry!

@nikravi nikravi closed this
@balupton
Owner

Cool you got it sorted, it's worth noting that such server extension should be done in the serverExtend event as that event will fire in the correct place for such extensions due to positioning of middlewares

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.