mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[cli/serve] allow disabling the base path proxy if needed
This commit is contained in:
parent
7db9c91d90
commit
1b85822e26
3 changed files with 12 additions and 5 deletions
|
@ -15,7 +15,9 @@ module.exports = class ClusterManager {
|
|||
this.log = new Log(opts.quiet, opts.silent);
|
||||
this.addedCount = 0;
|
||||
|
||||
this.basePathProxy = new BasePathProxy(this, settings);
|
||||
if (opts.basePathProxy) {
|
||||
this.basePathProxy = new BasePathProxy(this, settings);
|
||||
}
|
||||
|
||||
this.workers = [
|
||||
this.optimizer = new Worker({
|
||||
|
@ -25,7 +27,7 @@ module.exports = class ClusterManager {
|
|||
argv: compact([
|
||||
'--plugins.initialize=false',
|
||||
'--server.autoListen=false',
|
||||
`--server.basePath=${this.basePathProxy.basePath}`
|
||||
this.basePathProxy && `--server.basePath=${this.basePathProxy.basePath}`
|
||||
]),
|
||||
watch: false
|
||||
}),
|
||||
|
@ -34,8 +36,8 @@ module.exports = class ClusterManager {
|
|||
type: 'server',
|
||||
log: this.log,
|
||||
argv: compact([
|
||||
`--server.port=${this.basePathProxy.targetPort}`,
|
||||
`--server.basePath=${this.basePathProxy.basePath}`
|
||||
this.basePathProxy && `--server.port=${this.basePathProxy.targetPort}`,
|
||||
this.basePathProxy && `--server.basePath=${this.basePathProxy.basePath}`
|
||||
])
|
||||
})
|
||||
];
|
||||
|
@ -60,7 +62,9 @@ module.exports = class ClusterManager {
|
|||
startCluster() {
|
||||
this.setupManualRestart();
|
||||
invoke(this.workers, 'start');
|
||||
this.basePathProxy.listen();
|
||||
if (this.basePathProxy) {
|
||||
this.basePathProxy.listen();
|
||||
}
|
||||
}
|
||||
|
||||
setupWatching() {
|
||||
|
|
|
@ -107,6 +107,7 @@ module.exports = function (program) {
|
|||
command
|
||||
.option('--dev', 'Run the server with development mode defaults')
|
||||
.option('--no-ssl', 'Don\'t run the dev server using HTTPS')
|
||||
.option('--no-base-path', 'Don\'t put a proxy in front of the dev server, which adds a random basePath')
|
||||
.option('--no-watch', 'Prevents automatic restarts of the server in --dev mode');
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,8 @@ module.exports = function (grunt) {
|
|||
args: [
|
||||
'--dev',
|
||||
'--no-watch',
|
||||
'--no-ssl',
|
||||
'--no-base-path',
|
||||
'--server.port=5610',
|
||||
'--optimize.lazyPort=5611',
|
||||
'--optimize.lazyPrebuild=true',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue