-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: add http.createStaticServer
#45096
Open
aduh95
wants to merge
34
commits into
nodejs:main
Choose a base branch
from
aduh95:http-server
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
318610e
http: add `http.createStaticServer`
aduh95 77e0416
Add docs and parameters
aduh95 b1cb361
default to `'localhost'`, return server, update docs
aduh95 ac549c4
Apply suggestions from code review
aduh95 d3b189f
Ensure the server doesn't start if it's being required
aduh95 b6dbf4f
use options instead of function arguments
aduh95 bc6fd54
s/Simple/Static/
aduh95 39dbb48
add `mimeOverrides` option
aduh95 c53b51e
add `serveDotFiles` option
aduh95 c394473
add `filter` option
aduh95 6502cbc
`stream.promises.pipeline`
aduh95 9d408e7
add more validation
aduh95 9a9caa7
Revert "`stream.promises.pipeline`"
aduh95 bd9a6bd
fixup! add more validation
aduh95 a0c7864
pass two args to `filter`
aduh95 20e3d86
serve index files with correct MIME
aduh95 98a5563
add tests
aduh95 1259d43
add fixtures files
aduh95 f3d663d
lint
aduh95 60d3f0b
rename `http/server` -> `http/static`
aduh95 41fc901
list missing features in docs
aduh95 47d2f8b
add tests to ensure that using a "hidden" folder as root is blocked b…
aduh95 fa52ee0
Use 403 instead of 401
aduh95 968efde
fix type in docs
aduh95 5e018ef
remove `http/static` module
aduh95 3698f0c
add line return
aduh95 d8ce4b3
add `log` and `onStart` option to let user control logging
aduh95 0c91db4
add tests to ensure using `..` can't escape the root dir
aduh95 7b40455
add tests with encoded chars and several slashes in a row
aduh95 0bc9f5e
liint + `.json`
aduh95 29257f9
Apply suggestions from code review
aduh95 a5ea0d7
fix failing test
aduh95 c1e6869
move `mime` out of `requestHandler`
aduh95 2e63aba
fix lint
aduh95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add line return
- Loading branch information
commit 3698f0c010463b5feb0357a8bb3686ed8ba15cdb
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are exposing this as a public function, we should not be using
console.log()
in it. Logging should be configurable somehow.