nodejs / nodejs/node

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

Aperta
#45,079 26 commenti 10 reazioni 1 assegnatario Vedi su GitHub

@ErickWendel ci sta già lavorando.

Dal 19/10/2022.

feature request never-stale tools
Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.