Skip to content

Commit

Permalink
fix: typo in web-server.js (#355)
Browse files Browse the repository at this point in the history
* fix: typo in web-server.js

* fix: correct build script (#358)

* fix: correct build script

* fix: build

* fix: build

* fix: restore missing file

* fix: correct sed chapter sample (#353)

* fix: correct the 'sed' chapter sample file

* fix: correct weight to match book

* fix: correct quotes to match book

* fix: correct samples

* fix: update diagrams (#348)

* fix: correct build script (#358)

* fix: correct build script

* fix: build

* fix: build

* fix: restore missing file

* fix: correct the 'sed' chapter sample file

* Add instructions for how to quit less (#354)

I've seen a lot of beginners get very confused and stuck when they have
opened up `less` and it's not obvious how to get out.

* docs: add illicitonion as a contributor for doc (#359)

* docs: update README.md [skip ci]

* docs: update docs/xx-appendices/thanks.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

---------

Co-authored-by: Daniel Wagner-Hall <[email protected]>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 24, 2025
1 parent ab282c4 commit 2bde6de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/programs/web-server/web-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const log = levels.reduce((logObject, level) => {
}, {});

// Helper to return an optional numeric environment variable or the default.
function getOptonalEnvInt(name, defaultValue) {
function getOptionalEnvInt(name, defaultValue) {
const val = process.env[name];
if (!val) return defaultValue;
const intVal = parseInt(val, 10);
Expand All @@ -31,7 +31,7 @@ function getOptonalEnvInt(name, defaultValue) {
// environment variables.
const config = {
host: process.env.HOST || 'localhost',
port: process.env.PORT || getOptonalEnvInt('PORT', 8080),
port: process.env.PORT || getOptionalEnvInt('PORT', 8080),
root: process.env.ROOT || process.cwd(),
defaultPage: 'index.html',
};
Expand Down

0 comments on commit 2bde6de

Please sign in to comment.