Merge remote-tracking branch 'upstream/master' into esm_update
This commit is contained in:
parent
d806724621
commit
6642f2e2d5
1 changed files with 50 additions and 49 deletions
99
src/main.js
99
src/main.js
|
|
@ -21,58 +21,59 @@ if (args.length >= 3 && args[2][0] !== '-') {
|
||||||
|
|
||||||
import {program} from 'commander';
|
import {program} from 'commander';
|
||||||
program
|
program
|
||||||
.description('tileserver-gl startup options')
|
.description('tileserver-gl startup options')
|
||||||
.usage('tileserver-gl [mbtiles] [options]')
|
.usage('tileserver-gl [mbtiles] [options]')
|
||||||
.option(
|
.option(
|
||||||
'--mbtiles <file>',
|
'--mbtiles <file>',
|
||||||
'MBTiles file (uses demo configuration);\n' +
|
'MBTiles file (uses demo configuration);\n' +
|
||||||
'\t ignored if the configuration file is also specified'
|
'\t ignored if the configuration file is also specified'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-c, --config <file>',
|
'-c, --config <file>',
|
||||||
'Configuration file [config.json]',
|
'Configuration file [config.json]',
|
||||||
'config.json'
|
'config.json'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-b, --bind <address>',
|
'-b, --bind <address>',
|
||||||
'Bind address'
|
'Bind address'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-p, --port <port>',
|
'-p, --port <port>',
|
||||||
'Port [8080]',
|
'Port [8080]',
|
||||||
8080,
|
8080,
|
||||||
parseInt
|
parseInt
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-C|--no-cors',
|
'-C|--no-cors',
|
||||||
'Disable Cross-origin resource sharing headers'
|
'Disable Cross-origin resource sharing headers'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-u|--public_url <url>',
|
'-u|--public_url <url>',
|
||||||
'Enable exposing the server on subpaths, not necessarily the root of the domain'
|
'Enable exposing the server on subpaths, not necessarily the root of the domain'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-V, --verbose',
|
'-V, --verbose',
|
||||||
'More verbose output'
|
'More verbose output'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-s, --silent',
|
'-s, --silent',
|
||||||
'Less verbose output'
|
'Less verbose output'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-l|--log_file <file>',
|
'-l|--log_file <file>',
|
||||||
'output log file (defaults to standard out)'
|
'output log file (defaults to standard out)'
|
||||||
)
|
)
|
||||||
.option(
|
.option(
|
||||||
'-f|--log_format <format>',
|
'-f|--log_format <format>',
|
||||||
'define the log format: https://github.com/expressjs/morgan#morganformat-options'
|
'define the log format: https://github.com/expressjs/morgan#morganformat-options'
|
||||||
)
|
)
|
||||||
.version(
|
.version(
|
||||||
packageJson.version,
|
packageJson.version,
|
||||||
'-v, --version'
|
'-v, --version'
|
||||||
);
|
)
|
||||||
program.parse(process.argv);
|
program.parse(process.argv);
|
||||||
const opts = program.opts();
|
const opts = program.opts();
|
||||||
|
|
||||||
console.log(`Starting ${packageJson.name} v${packageJson.version}`);
|
console.log(`Starting ${packageJson.name} v${packageJson.version}`);
|
||||||
|
|
||||||
const startServer = (configPath, config) => {
|
const startServer = (configPath, config) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue