开发者

Express Ignores RegExp routes, but serves string routes?

I'm met with a perplexing issue today. I've been building a CMS system in Zappa, which uses the Express framework. I'm doing custom routing, so I have quite a few "Catch all" routes. Basically, if a route isn't claimed by the system, thi开发者_运维技巧s instead pings the database and sees if the user has defined content at that route, and displays it if it exists.

This was working beautifully until today. I don't know what I did (I was working on something completely different and made about a bazillion changes) but suddenly RegExp routes stopped working. Completely, it's as though Express just ignores them alltogether.

The following code works:

get '/', ->
    render 'some_view'

and the following code does not:

get /\//, ->
    render 'some_view'

This is just an example of course. All RegExp routes are being ignored.

I'm at a loss. I've tried removing the dynamicHelpers that I was working, on, my entire auth module (which didn't exist before today) and every other major thing I could think of in turn. I haven't done anything to node.js other than install bcrypt and node-validator. Why is Express suddenly ignoring one type of route, but not another?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜