Sails version: 0.12.7
Node version: 6.9.0
NPM version: 3.10.8
Operating system: Win 10 Pro
If your route's target has a forward slash in the path to your controller it will fail to register it, if you use two back slashes it is fine. It is really very easy to reproduce.:
'get /v1/status1': 'v1\\StatusController.index''get /v1/status2': 'v1/StatusController.index' /v1/status1 route will work v1/status2 will not. It should also be noted this behaviour has only been observed on Windows so far.
It should also be noted this started happening in sails 0.12.5. In the above statement the reverse is true in regards to routes prior to 0.12.5
This also largely seems to be a duplication of #3856, but I don't think that issue is passing the communist Sailsbot issue-submission system filters, so I'm filing this here to see if it works.
You could write
'get /v1/status1': 'v1' + path.sep + 'StatusController.index'
This should work, shouldn't it?
@karsasmus I appreciate the suggestion, but this is only a recent change in behaviour and impacts all Windows users when it was working fine previously. However on another note, If slashes need to be platform filtered this way and that is the way Sails wants to role then okay, but it seems a little silly to me.
Thanks @karsasmus and @leegdavis - we're looking into it.
This also largely seems to be a duplication of #3856, but I don't think that issue is passing the communist Sailsbot issue-submission system filters, so I'm filing this here to see if it works.
I consider myself more of a benevolent despot, thank you very much.
Okay! @mikermcneil just published a patch (version 1.0.7) to the include-all dependency in Sails which should fix this issue. To test, please re-install Sails via:
npm install sails --force
or (if you have Sails installed globally)
npm install sails -g --force
To be clear, _only_ route targets with forward slashes are supported, so after this fix this should work:
'get /v1/status2': 'v1/StatusController.index'
but there's no guarantee that this will:
'get /v1/status1': 'v1\\StatusController.index'
@LeeGDavis please give it a whirl and let us know if you can verify the fix!
Touch茅 @sailsbot. We shall meet again Good Sir!
@sgress454 @mikermcneil Confirmed, that fix works and restores the previous functionality. Also the double backslash does not work, but that has no impact on us and I didn't work prior to this bug. Thanks for the quick turn around!
馃憤 Thanks for following up!
Most helpful comment
I consider myself more of a benevolent despot, thank you very much.