Skip to content

Commit

Permalink
Use port 3000 by default, and fall back to some other arbitrary port …
Browse files Browse the repository at this point in the history
…if 3000 is already in use. Fixes #470
  • Loading branch information
dumbmatter committed Dec 3, 2024
1 parent f312e24 commit 132b367
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ Run

pnpm run start

and point your browser to <http://localhost:3000/>. If you use the command `pnpm
and point your browser to <http://localhost:3000/> (or it will use a different
port if 3000 is already used by somethign else). If you use the command `pnpm
run start-watch` from above, then running the command `pnpm run start` is not
necessary.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"eslint-plugin-react-hooks": "^5.0.0",
"fake-indexeddb": "^6.0.0",
"fs-extra": "^11.2.0",
"get-port": "^7.1.0",
"globals": "^15.13.0",
"html-minifier-terser": "^7.2.0",
"husky": "^9.1.7",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tools/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import fs from "node:fs";
import http from "node:http";
import path from "node:path";
import os from "node:os";
import getPort from "get-port";

const port = 3006;
const port = await getPort({ port: 3000 });

const mimeTypes = {
".bmp": "image/bmp",
Expand Down

0 comments on commit 132b367

Please sign in to comment.