From d492c5abe3c7c0716b9695c8a40d0256569d2338 Mon Sep 17 00:00:00 2001 From: Ry Dahl Date: Thu, 9 Jan 2020 11:37:01 -0700 Subject: feat: Deno.args now does not include script (#3628) Previously Deno.args was ["script.js", "arg1", "arg2"] Now it is just ["arg1", "arg2"] BREAKING CHANGE --- tools/deno_http_proxy.ts | 4 ++-- tools/deno_tcp.ts | 2 +- tools/deno_tcp_proxy.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/deno_http_proxy.ts b/tools/deno_http_proxy.ts index 75ea4b241..589a14338 100644 --- a/tools/deno_http_proxy.ts +++ b/tools/deno_http_proxy.ts @@ -1,8 +1,8 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { serve, ServerRequest } from "../std/http/server.ts"; -const addr = Deno.args[1] || "127.0.0.1:4500"; -const originAddr = Deno.args[2] || "127.0.0.1:4501"; +const addr = Deno.args[0] || "127.0.0.1:4500"; +const originAddr = Deno.args[1] || "127.0.0.1:4501"; const server = serve(addr); async function proxyRequest(req: ServerRequest): Promise { diff --git a/tools/deno_tcp.ts b/tools/deno_tcp.ts index 13ebe76af..9a884cb70 100644 --- a/tools/deno_tcp.ts +++ b/tools/deno_tcp.ts @@ -2,7 +2,7 @@ // TODO Replace this with a real HTTP server once // https://github.com/denoland/deno/issues/726 is completed. // Note: this is a keep-alive server. -const addr = Deno.args[1] || "127.0.0.1:4500"; +const addr = Deno.args[0] || "127.0.0.1:4500"; const [hostname, port] = addr.split(":"); const listener = Deno.listen({ hostname, port: Number(port) }); const response = new TextEncoder().encode( diff --git a/tools/deno_tcp_proxy.ts b/tools/deno_tcp_proxy.ts index 487825648..bf54ad1c0 100644 --- a/tools/deno_tcp_proxy.ts +++ b/tools/deno_tcp_proxy.ts @@ -1,6 +1,6 @@ // Used for benchmarking Deno's tcp proxy perfromance. See tools/http_benchmark.py -const addr = Deno.args[1] || "127.0.0.1:4500"; -const originAddr = Deno.args[2] || "127.0.0.1:4501"; +const addr = Deno.args[0] || "127.0.0.1:4500"; +const originAddr = Deno.args[1] || "127.0.0.1:4501"; const [hostname, port] = addr.split(":"); const [originHostname, originPort] = originAddr.split(":"); -- cgit v1.2.3