mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-11 18:30:25 +08:00
[API节点]支持HTTP API
This commit is contained in:
@@ -3,10 +3,29 @@ Tea.context(function () {
|
||||
|
||||
this.hasHTTPS = this.node.listens.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
})
|
||||
}) || (this.node.restIsOn && this.node.restListens.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
this.grpcAddrs = []
|
||||
this.restAddrs = []
|
||||
|
||||
this.changeListens = function (addrs) {
|
||||
this.hasHTTPS = addrs.$any(function (k, v) {
|
||||
this.grpcAddrs = addrs
|
||||
|
||||
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
})
|
||||
}) || (this.node.restIsOn && this.restAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
}
|
||||
|
||||
this.changeRestListens = function (addrs) {
|
||||
this.restAddrs = addrs
|
||||
|
||||
this.hasHTTPS = this.grpcAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}) || (this.node.restIsOn && this.restAddrs.$any(function (k, v) {
|
||||
return v.protocol == "https"
|
||||
}))
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user