Add http.serve() API based on Fetch (Request -> Response)
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- JavaScript
- Estrellas
- 122k
- Forks
- 37.3k
- Merge medio
- 4 d 2 h
- PR fusionados (30 d)
- 283
Descripción
What is the problem this feature will solve?
Node provides fetch, Request/Response, and Web Streams, but no high level server API using this model.
Other runtimes such as Deno and Bun expose a serve API based on the Fetch contract. In Node, similar patterns are commonly implemented in userland (e.g., frameworks like Hono), which indicates demand for this abstraction.
This was discussed in #42529 and received support, however that issue is focused on request.toWeb(), so opening a separate issue focused on this API.
What is the feature you are proposing to solve the problem?
Add a high-level http.serve(handler) API.
An example shape could be:
http.serve((req) => new Response("ok"))
handler: (Request) => Response | Promise<Response>
This would coexist with the existing http.createServer, and be a high level alternative using WHATWG APIs instead.
What alternatives have you considered?
- Continue using
http.createServerdirectly. - Implement this in userland, or use existing 3rd party solutions.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza revisando la API http.createServer existente de Node y la discusión en el issue #42529. El trabajo propuesto consiste en definir y añadir http.serve(handler) usando Request y Response, manteniendo createServer disponible. Se considera terminado cuando la forma y el comportamiento de la API estén acordados, implementados y cubiertos para handlers síncronos y asíncronos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, nodejs
- Área
- backend-api-design
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100