diff --git a/client/scripts/start.js b/client/scripts/start.js index b62903d0..386db078 100644 --- a/client/scripts/start.js +++ b/client/scripts/start.js @@ -20,7 +20,10 @@ const paths = require('../../shared/config/paths'); const config = require('../config/webpack.config.dev'); const createDevServerConfig = require('../config/webpackDevServer.config'); -const userConfig = require('../../config'); +const {proxy: floodServerProxy} = require('yargs').env('FLOOD_OPTION_').option('proxy', { + default: 'http://127.0.0.1:3000', + type: 'string', +}).argv; const isInteractive = process.stdout.isTTY; @@ -46,7 +49,7 @@ choosePort(HOST, DEFAULT_PORT) // Create a webpack compiler that is configured with custom messages. const compiler = webpack(config); // Serve webpack assets generated by the compiler over a web sever. - const serverConfig = createDevServerConfig(userConfig.floodServerProxy, urls.lanUrlForConfig); + const serverConfig = createDevServerConfig(floodServerProxy, urls.lanUrlForConfig); const devServer = new WebpackDevServer(compiler, serverConfig); // Launch WebpackDevServer. devServer.listen(port, HOST, (err) => { diff --git a/config.ts b/config.ts index 66c6adfb..29646061 100644 --- a/config.ts +++ b/config.ts @@ -155,12 +155,6 @@ const {argv} = yargs hidden: true, type: 'string', }) - .option('proxy', { - default: 'http://127.0.0.1:3000', - describe: 'DEV ONLY: See the "Local Development" section of README.md', - hidden: true, - type: 'string', - }) .option('test', { default: false, describe: 'DEV ONLY: Test setup', @@ -291,7 +285,6 @@ const result = configSchema.safeParse({ configUser: connectionSettings, floodServerHost: argv.host, floodServerPort: argv.port, - floodServerProxy: argv.proxy, maxHistoryStates: argv.maxhistorystates, torrentClientPollInterval: argv.clientpoll, torrentClientPollIntervalIdle: argv.clientpollidle, diff --git a/shared/schema/Config.ts b/shared/schema/Config.ts index 54bec540..56cd8272 100644 --- a/shared/schema/Config.ts +++ b/shared/schema/Config.ts @@ -73,11 +73,6 @@ export const configSchema = object({ // The port that Flood should listen for web connections on. [default: 3000] floodServerPort: number().int().positive(), - // CLI argument: --proxy - // Used for development only. Not used in production. - // See the "Local Development" section of README.md for detail. - floodServerProxy: string().url().optional(), - // CLI argument: --maxhistorystates // Flood keeps a history of torrent download and upload speeds. // This value dictates the number of individual records per period to keep.