Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

make npm.getShort URL configurable #474

Closed
KidkArolis opened this issue Oct 14, 2014 · 3 comments · Fixed by #475
Closed

make npm.getShort URL configurable #474

KidkArolis opened this issue Oct 14, 2014 · 3 comments · Fixed by #475

Comments

@KidkArolis
Copy link
Contributor

Hi, I've noticed there's one URL that is hardcoded and not configurable at the moment.
https://github.com/cnpm/cnpmjs.org/blob/master/proxy/npm.js#L77

This unfortunately breaks syncing for my usecase where I'm not syncing from the official npm.

How could we make this configurable. I see a couple of options:

  1. create yet another config option config.sourceNpmRegistryWithShortSupport
  2. simply use config.sourceNpmRegistry and if it doesn't support /-/short, syncing won't work. in this case, setting sourceNpmRegistry to http://registry.npm.taobao.org (default) or http://r.cnpmjs.org makes sure syncing works.
  3. check if config.sourceNpmRegistryIsCNpm is true which case use the config.sourceNpmRegistry else fallback to http://r.cnpmjs.org
  4. don't use the /-/short API now that it's not supported in npm any longer - this is more work however.

Option 3 seems the simplest for now and backwards compatible - I'll make a PR for that, but please let me know your thoughts.

@dead-horse
Copy link
Member

I'll try to find another way to replace /-/short API. thanks again, and cnpmjs.org@1.7.0 published to npm.

@fengmk2
Copy link
Member

fengmk2 commented Oct 15, 2014

WTF .... there's no way to full sync from registry.npmjs.org now ...

@KidkArolis
Copy link
Contributor Author

Which sourceRegistry are you using? And perhaps setting
sourceRegistryIsCnpm to false in the config can fix the issue?
On Oct 15, 2014 11:16 AM, "fengmk2" notifications@github.com wrote:

WTF .... there's no way to full sync from registry.npmjs.org now ...


Reply to this email directly or view it on GitHub
#474 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants