summaryrefslogtreecommitdiff
path: root/std/http/testdata/simple_server.ts
diff options
context:
space:
mode:
authorYusuke Sakurai <kerokerokerop@gmail.com>2020-03-21 22:53:47 +0900
committerGitHub <noreply@github.com>2020-03-21 09:53:47 -0400
commit60cee4f045778777a16b6fffd6d5b9a1400d7246 (patch)
treea477bd147fbd548d478a289af5bd0681b1a34c4e /std/http/testdata/simple_server.ts
parent0adc86f105204b2475126c36dfc10e678f67df56 (diff)
avoid using same port number for test (#4147)
Diffstat (limited to 'std/http/testdata/simple_server.ts')
-rw-r--r--std/http/testdata/simple_server.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/std/http/testdata/simple_server.ts b/std/http/testdata/simple_server.ts
index d8ca4cc97..05f169705 100644
--- a/std/http/testdata/simple_server.ts
+++ b/std/http/testdata/simple_server.ts
@@ -2,8 +2,9 @@
// This is an example of a server that responds with an empty body
import { serve } from "../server.ts";
-const addr = "0.0.0.0:4502";
-console.log(`Simple server listening on ${addr}`);
+const port = parseInt(Deno.args[0] || "4502");
+const addr: Deno.ListenOptions = { port };
+console.log(`Simple server listening on ${port}`);
for await (const req of serve(addr)) {
req.respond({});
}