delect white space

This commit is contained in:
wuls 2023-05-23 11:33:33 +08:00 committed by Nate Moore
parent f257895e43
commit 0e1e20b817

View file

@ -40,14 +40,11 @@ export default function startServer(app: NodeApp, options: Options) {
const port = process.env.PORT ? Number(process.env.PORT) : options.port ?? 8080; const port = process.env.PORT ? Number(process.env.PORT) : options.port ?? 8080;
const { client } = resolvePaths(options); const { client } = resolvePaths(options);
const handler = middleware(app, options.mode); const handler = middleware(app, options.mode);
// Allow to provide host value at runtime // Allow to provide host value at runtime
const host = getResolvedHostForHttpServer( const host = getResolvedHostForHttpServer(
process.env.HOST !== undefined && process.env.HOST !== '' ? process.env.HOST : options.host process.env.HOST !== undefined && process.env.HOST !== '' ? process.env.HOST : options.host
); );
const server = createServer( const server = createServer(
{ {
client, client,
@ -57,6 +54,7 @@ export default function startServer(app: NodeApp, options: Options) {
}, },
handler handler
); );
const protocol = server.server instanceof https.Server ? 'https' : 'http'; const protocol = server.server instanceof https.Server ? 'https' : 'http';
const address = getNetworkAddress(protocol, host!, port) const address = getNetworkAddress(protocol, host!, port)