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

250
Vistas
ExpressJS/NodeJS : res.redirect Not Woking

I have written the code for checking whether an user exists or not . On the basis of that, we are redirecting using res.redirect .

app.post('/UserRegister', async (req, res, next) => {
    const { username, password } = req.body;
    const isTheir = await User.exists({ username: username});
    console.log(isTheir);
    if (isTheir==true) {
        return next(new AppError("User Already Registered", 501));
    }
    const user = new User({username});
    const registeredUser = await User.register(user, password);
    console.log("Going to Search Flights");
    res.redirect('/searchFlights');    
});

It seems that the res.redirect is not working since it's not going to searchFlights . Please help .

about 4 years ago · Juan Pablo Isaza
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