This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 744
Deploy
fengmk2 edited this page Feb 23, 2016
·
25 revisions
- Node >= 4.2
- MySQL >= 0.5.0, include
mysqld
andmysql
cli - Simple File Store Service, like qiniu, aliyun-oss, tfs, upyun
- First you need create your own mysql database and tables. Get all the sqls here.
- Then you can see a complete example here custom-cnpm-example.
# clone from github
$ git clone git://github.com/cnpm/cnpmjs.org.git $HOME/cnpmjs.org
$ cd $HOME/cnpmjs.org
# create mysql tables
$ mysql -u yourname -p
mysql> use cnpmjs;
mysql> source docs/db.sql
$ vim config/config.js
module.exports = {
debug: false,
enableCluster: true, // enable cluster mode
mysqlServers: [
{
host: 'localhost',
port: 3306,
user: 'cnpmjs',
password: 'cnpmjs123',
}
],
mysqlDatabase: 'cnpmjstest',
enablePrivate: true, // enable private mode, only admin can publish, other use just can sync package from source npm
admins: {
admin: 'admin@cnpmjs.org',
},
syncModel: 'exist'// 'none', 'all', 'exist'
};
$ make install
$ npm run start
#open registry and web
# registry
open http://localhost:7001
# web
open http://localhost:7002
See an example with oss: oss-cnpm
Use oss-cnpm
:
- First install oss-cnpm
$ cd $HOME/cnpmjs.org
$ cnpm install oss-cnpm
- Then edit the
config/config.js
, addnfs
options:
nfs: require('oss-cnpm').create()
Copyright @ 2013 - present cnpmjs.org