config: move floodServerProxy to client DevServer script

This commit is contained in:
Jesse Chan
2021-01-30 19:18:30 +08:00
parent 5afa79b274
commit 6c858dfc0e
3 changed files with 5 additions and 14 deletions

View File

@@ -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) => {

View File

@@ -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,

View File

@@ -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.