2016-04-08 24 views
0

不确定如何标题,但这里是我想要做的。 我有一些私人节点模块,我想使用许可证密钥提供。虚拟.git存档与节点模块的许可证密钥

所以节点模块的安装应该看起来像:

npm install http://example.com/example.git?key=12123123 

我不想example.git是一个实际的git的实例。如果他们的关键是有效的,我希望能够得到适当的节点存档。我可以使用php来处理关键验证,但不确定输出格式应该是什么。

感谢, 拉杜

回答

0

真正归档Git仓库为GZ压缩包允许我使用NPM安装,所以我有

NPM安装http://example.com/repo.php?key=123123123

里面repo.php我有

安装它
header('Content-Description: File Transfer'); 
header('Content-Type: application/octet-stream'); 
header('Content-Length: ' . filesize($file)); 
header('Content-Disposition: attachment; filename=' . basename($file)); 
readfile($f_location);