Skip to content

Commit

Permalink
BREAKING: There is no public Rust API for the CLI (denoland/deno#5226)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry authored May 11, 2020
1 parent 1bff06c commit 6b7d0f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion http/file_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const serverArgs = parse(args) as FileServerArgs;

const CORSEnabled = serverArgs.cors ? true : false;
const target = posix.resolve(serverArgs._[1] ?? "");
const addr = `0.0.0.0:${serverArgs.port ?? serverArgs.p ?? 4500}`;
const addr = `0.0.0.0:${serverArgs.port ?? serverArgs.p ?? 4507}`;

const MEDIA_TYPES: Record<string, string> = {
".md": "text/markdown",
Expand Down
10 changes: 5 additions & 5 deletions http/file_server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function killFileServer(): void {
test("file_server serveFile", async (): Promise<void> => {
await startFileServer();
try {
const res = await fetch("http://localhost:4500/README.md");
const res = await fetch("http://localhost:4507/README.md");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEquals(res.headers.get("content-type"), "text/markdown");
Expand All @@ -53,7 +53,7 @@ test("file_server serveFile", async (): Promise<void> => {
test("serveDirectory", async function (): Promise<void> {
await startFileServer();
try {
const res = await fetch("http://localhost:4500/");
const res = await fetch("http://localhost:4507/");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
const page = await res.text();
Expand All @@ -75,7 +75,7 @@ test("serveDirectory", async function (): Promise<void> {
test("serveFallback", async function (): Promise<void> {
await startFileServer();
try {
const res = await fetch("http://localhost:4500/badfile.txt");
const res = await fetch("http://localhost:4507/badfile.txt");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEquals(res.status, 404);
Expand All @@ -88,12 +88,12 @@ test("serveFallback", async function (): Promise<void> {
test("serveWithUnorthodoxFilename", async function (): Promise<void> {
await startFileServer();
try {
let res = await fetch("http://localhost:4500/http/testdata/%");
let res = await fetch("http://localhost:4507/http/testdata/%");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEquals(res.status, 200);
let _ = await res.text();
res = await fetch("http://localhost:4500/http/testdata/test%20file.txt");
res = await fetch("http://localhost:4507/http/testdata/test%20file.txt");
assert(res.headers.has("access-control-allow-origin"));
assert(res.headers.has("access-control-allow-headers"));
assertEquals(res.status, 200);
Expand Down

0 comments on commit 6b7d0f4

Please sign in to comment.