A webservice that dishes out files from npm packages.
docker run -v /cdn-cache-folder:/cdn -p 8080:8080 euprogramador/npm-cdn
case run a server as sinopia npm server you can specify which server will connect via environment variable, NPM_HOST by default is used http://registry.npmjs.org/. example:
docker run -v /cdn-cache-folder:/cdn -p 8080:8080 -e NPM_HOST=http://sinopia.myserver.local/ euprogramador/npm-cdn
NOTE: You have the "/" end in url.
To access a file inside a published npm package, use the following pattern:
http://myserver.com:8080/{packageName}@{packageVersion}/{filePath}
Examples:
When a package is downloaded, index files are generated in HTML and JSON format.
application/json
Accept header in the request instead of using the json query param.If you request a package without specifying a version, you'll be redirected to the index for the latest version of the package:
Content type
Image
Digest
Size
256.9 MB
Last updated
over 10 years ago
docker pull euprogramador/npm-cdn