nodejs / nodejs/node

feat: Implement a way to expose static files from a directory (similar to Python SimpleHttpServer)

Offen
#45,079 26 Kommentare 10 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@ErickWendel arbeitet bereits daran.

Seit 19.10.2022.

feature request never-stale tools
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

What is the problem this feature will solve?

HTTP Server is a very popular package with 1M+ weekly downloads used to expose static files from a directory.

Node.js doesn't have any native way to expose static files in a directory from a single command.

This is an idea given by @ruyadorno during a session on Tooling WG at https://github.com/nodejs/tooling/issues/164 which he suggested I implement it.

What is the feature you are proposing to solve the problem?

In Python, they have the SimpleHTTPServer a native module meant for the development environment and has basic security checks.

The idea is not to replace the HTTP Server package, as it's a robust package, but to have a similar implementation to Python's SimpleHTTPServer exposing directory files.

Adding something like:

node --serve directory -p 3000

or

node --serve . 
#with a default port
What alternatives have you considered?

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.