Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.Veneno.
wechaty
提交
959134f9
W
wechaty
项目概览
.Veneno.
/
wechaty
与 Fork 源项目一致
Fork自
wechaty / wechaty
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
wechaty
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
959134f9
编写于
10月 01, 2016
作者:
Huan (李卓桓)
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
get rid of global config DEFAULT_PUPPET_PORT
上级
db17bab1
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
10 addition
and
6 deletion
+10
-6
package.json
package.json
+0
-1
src/config.spec.js
src/config.spec.js
+0
-1
src/puppet-web/puppet-web.js
src/puppet-web/puppet-web.js
+3
-1
src/puppet-web/server.js
src/puppet-web/server.js
+7
-2
test/wechaty.spec.js
test/wechaty.spec.js
+0
-1
未找到文件。
package.json
浏览文件 @
959134f9
...
...
@@ -8,7 +8,6 @@
"DEFAULT_PUPPET"
:
"web"
,
"DEFAULT_PROFILE"
:
"profile"
,
"DEFAULT_PORT"
:
8788
,
"DEFAULT_PUPPET_PORT"
:
18788
,
"DEFAULT_PROTOCOL"
:
"io|0.0.1"
,
"DEFAULT_TOKEN"
:
"WECHATY_IO_TOKEN"
,
"DEFAULT_APIHOST"
:
"api.wechaty.io"
,
...
...
src/config.spec.js
浏览文件 @
959134f9
...
...
@@ -16,7 +16,6 @@ test('Config list vars', t => {
t
.
truthy
(
Config
.
DEFAULT_PORT
,
'
should export DEFAULT_PORT
'
)
t
.
truthy
(
Config
.
DEFAULT_PROFILE
,
'
should export DEFAULT_PROFILE
'
)
t
.
truthy
(
Config
.
DEFAULT_HEAD
,
'
should export DEFAULT_HEAD
'
)
t
.
truthy
(
Config
.
DEFAULT_PUPPET_PORT
,
'
should export DEFAULT_PUPPET_PORT
'
)
t
.
truthy
(
Config
.
DEFAULT_PROTOCOL
,
'
should export DEFAULT_PROTOCOL
'
)
t
.
truthy
(
Config
.
DEFAULT_APIHOST
,
'
should export DEFAULT_APIHOST
'
)
t
.
truthy
(
Config
.
CMD_CHROMIUM
,
'
should export CMD_CHROMIUM
'
)
...
...
src/puppet-web/puppet-web.js
浏览文件 @
959134f9
...
...
@@ -36,6 +36,8 @@ const Watchdog = require('./watchdog')
const
UtilLib
=
require
(
'
../util-lib
'
)
const
Config
=
require
(
'
../config
'
)
const
DEFAULT_PUPPET_PORT
=
18788
// // W(87) X(88), ascii char code ;-]
class
PuppetWeb
extends
Puppet
{
constructor
({
head
=
Config
.
head
...
...
@@ -62,7 +64,7 @@ class PuppetWeb extends Puppet {
return
co
.
call
(
this
,
function
*
()
{
this
.
port
=
yield
UtilLib
.
getPort
(
Config
.
DEFAULT_PUPPET_PORT
)
this
.
port
=
yield
UtilLib
.
getPort
(
DEFAULT_PUPPET_PORT
)
log
.
verbose
(
'
PuppetWeb
'
,
'
init() getPort %d
'
,
this
.
port
)
yield
this
.
initAttach
(
this
)
...
...
src/puppet-web/server.js
浏览文件 @
959134f9
...
...
@@ -23,9 +23,14 @@ const EventEmitter = require('events')
class
Server
extends
EventEmitter
{
constructor
({
port
=
Config
.
DEFAULT_PUPPET_PORT
// W(87) X(88), ascii char code ;-]
}
=
{}
)
{
port
})
{
super
()
if
(
!
port
)
{
throw
new
Error
(
'
port not found
'
)
}
this
.
port
=
port
}
...
...
test/wechaty.spec.js
浏览文件 @
959134f9
...
...
@@ -26,5 +26,4 @@ test('Wechaty Config setting', t => {
t
.
truthy
(
Config
.
DEFAULT_HEAD
,
'
should has DEFAULT_HEAD
'
)
t
.
truthy
(
Config
.
DEFAULT_PUPPET
,
'
should has DEFAULT_PUPPET
'
)
t
.
truthy
(
Config
.
DEFAULT_PORT
,
'
should has DEFAULT_PORT
'
)
t
.
truthy
(
Config
.
DEFAULT_PUPPET_PORT
,
'
should has DEFAULT_PUPPET_PORT
'
)
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录