Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
Are there any advantages of http.server() over Express.js

Express framework is so huge, are there any cases where I should prefer http.createServer() over Express .get and .post?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

express seems rather tiny to me, compared with other packages.

One use case where even this package seems not justified is if I have to start up an http server only for one interaction, such as authenticating a desktop app with OAuth 2.0 with localhost as the loopback URI.

The following code snippet illustrates this, and also shows that code = req.query.code (which would be possible with express) must be replaced with something lengthier:

var oAuth2Client = new google.auth.OAuth2(...);
var loopback = http.createServer(function(req, res) {
  var code = new URL("http://" + req.url).searchParams.get("code");
  if (code) {
    oAuth2Client.getToken(code, (err, token) => {
      oAuth2Client.setCredentials(token);
      res.end();
    });
    loopback.close();
  }
}).listen(...);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda