Make API path resource configurable via pathPrefix#65
Make API path resource configurable via pathPrefix#65lenage wants to merge 0 commit intoyahoo:masterfrom
Conversation
|
Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄 |
|
CLA is valid! |
|
@lenage I talked to the team and we're comfortable with just getting rid of the whole |
|
sure,will update code soon,Thanks — On Tue, Mar 31, 2015 at 2:36 AM, Rajiv Tirumalareddy
|
|
@Vijar I have removed the 'resource/' prefix from url, maybe release a new minor version for it? |
|
@lenage This should be backwards compatible since only But, can you also remove |
|
@Vijar Removed and passed the test |
|
@lenage looks like this is out of date. If you can fix the conflicts, we can merge this. |
libs/fetcher.client.js
Outdated
There was a problem hiding this comment.
@lenage there is always a leading slash before the resource name so the if/else you added below isn't necessary
There was a problem hiding this comment.
Yes, i think so, i was remove the if/else before, but the test did not pass. here is the log:
1) Server Fetcher #middleware #GET should respond to GET api request:
Error: Fetcher "ock_service" could not be found
at Function.Fetcher.getFetcher (/Users/lenage/Projects/github/fetchr/libs/fetcher.js:78:19)
at Function.Fetcher.single (/Users/lenage/Projects/github/fetchr/libs/fetcher.js:175:31)
at /Users/lenage/Projects/github/fetchr/libs/fetcher.js:147:21
at Context.<anonymous> (/Users/lenage/Projects/github/fetchr/tests/unit/libs/fetcher.js:272:17)
at Test.Runnable.run (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runnable.js:233:15)
at Runner.runTest (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:387:10)
at /Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:470:12
at next (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:312:14)
at /Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:322:7
at next (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:257:23)
at Object._onImmediate (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:289:5)
at processImmediate [as _immediateCallback] (timers.js:354:15)
2) Server Fetcher #middleware #GET should respond to GET api request with custom status code:
Error: Fetcher "ock_service" could not be found
at Function.Fetcher.getFetcher (/Users/lenage/Projects/github/fetchr/libs/fetcher.js:78:19)
at Function.Fetcher.single (/Users/lenage/Projects/github/fetchr/libs/fetcher.js:175:31)
at /Users/lenage/Projects/github/fetchr/libs/fetcher.js:147:21
at Context.<anonymous> (/Users/lenage/Projects/github/fetchr/tests/unit/libs/fetcher.js:316:17)
at Test.Runnable.run (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runnable.js:233:15)
at Runner.runTest (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:387:10)
at /Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:470:12
at next (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:312:14)
at /Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:322:7
at next (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:257:23)
at Object._onImmediate (/Users/lenage/Projects/github/fetchr/node_modules/mocha/lib/runner.js:289:5)
at processImmediate [as _immediateCallback] (timers.js:354:15)
......
ock_service, any ideas?
There was a problem hiding this comment.
In tests/unit/libs/fetcher.js make sure to replace all instances of /resource/ with /. That should solve our problems.
|
@lenage I see the commit on your fork, but for some reason I can't see the changes in this PR's diff... Maybe squash these commits together into one and do another PR? |
In this PR,
I added an global var as default pathPrefix(/resource/), and provide an option
this.pathPrefixto make it configurable.NOTE: if you want to remove
/resource/prefix in path, please setthis.pathPrefixto''.