-
Notifications
You must be signed in to change notification settings - Fork 296
add opts param to IpfsAPI, allow 'protocol' config #67
Conversation
Is there a reason why we don't just make all the arguments |
@victorbjelkholm I like that idea, but can we make it in a way that doesn't break current usage? (when we release a ipfsAPI 3.0.0 we can make breaking changes like that) @ckeenan thank you for the PR, would you mind rebasing master first, so it gets a clean merge? + This seems to solve the problem also pointed out at #123 //cc @dignifiedquire ? |
@diasdavid rebased |
LGTM. Just missing the documentation on the README.md. @dignifiedquire @victorbjelkholm want to give your CR? |
For this PR please add docs in readme, a test checking this works and move the build into a separate commit. In general I think this is not the right approach though, what @jbenet mentioned makes much more sense we should start supporting |
Currently, ipfsAPI supports multiaddr https://github.com/ipfs/js-ipfs-api/blob/master/src/index.js#L19-L21, however it is expecting a |
I think we should support: 'http://localhost:5001'
'//localhost:5001'
'/ip4/127.0.0.1/http/5001'
{ host: 'localhost', port: 5001, protocol: 'http'} |
@diasdavid @dignifiedquire updated. Thoughts? |
@@ -766,4 +766,49 @@ describe('IPFS Node.js API wrapper tests', () => { | |||
}) | |||
}) | |||
}) | |||
|
|||
describe('constructor parameters', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this into a new file, this is getting out of hand
Thanks @ckeenan functionality wise this looks good, left some cr comments |
@dignifiedquire I updated with your requests. For multiple test files I parse the karma config's files for the mocha task, let me know if you want that handled differently |
@@ -47,7 +47,8 @@ module.exports = function (config) { | |||
basePath: '', | |||
frameworks: ['mocha'], | |||
files: [ | |||
'test/tests.js' | |||
'test/tests.js', | |||
'test/constructor.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to rename the files to all in end .spec.js
, so we can do test/*.spec.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That way you can pass the same glob to the mocha
config in tasks/test.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Added
Looks like you need to rebase on master again sorry :( |
No worries @dignifiedquire |
Thanks a lot. LGTM. So let's wait for @diasdavid to check and then we can ship this :) |
This is awesome, thank you @ckeenan and @dignifiedquire for reviewing it :) LGTM, going to merge and release |
add opts param to IpfsAPI, allow 'protocol' config
Should resolve #66