Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michaël Zasso <[email protected]>
Co-authored-by: Tobias Nießen <[email protected]>
  • Loading branch information
3 people committed Sep 19, 2023
1 parent ce13b38 commit a19a196
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -3589,6 +3589,8 @@ added: REPLACEME
files are filtered. **Default:** filters all dot files.
* `log` {Function|null} called when sending a response to the client.
**Default:** `console.log`.
* `statusCode` {integer} The status code that is sent to the client.
* `url` {string} the (origin-relative) URL that was requested.
* `onStart` {Function} called the server starts listening to requests.
**Default:** logs the URL to the console.

Expand All @@ -3600,10 +3602,10 @@ When specifying a `host` other than `localhost`, you are exposing your local
file system to all the machines that can connect to your computer.

If specified and not `null`, `filter` will be called with two arguments: the
first one if the request URL string (the URL that is present in the actual HTTP
first one is the request URL string (the URL that is present in the actual HTTP
request), and the second one is the `file:` `URL` that was generated from the
base directory and the request URL. If the function returns a falsy value, the
request will be blocked.
server will respond with a 403 HTTP error.

If `port` is omitted or is 0, the operating system will assign an arbitrary
unused port, which it's output will be the standard output.
Expand Down
1 change: 1 addition & 0 deletions lib/internal/http/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function createStaticServer(options = kEmptyObject) {
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.png': 'image/png',
'.wasm': 'application/wasm',
'.webp': 'image/webp',
'.woff2': 'font/woff2',
...mimeOverrides,
Expand Down

0 comments on commit a19a196

Please sign in to comment.