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

164
Vistas
require('express')().get('/test', ), it is a route with missing callback or it is a get method returns value of '/test' app setting?

Sorry, I am new to express. I have following doubt.

Suppose, I missed specifying callback with express().get('/v1/message-get',) method, then it is treated as normal get method (Returns the value of '/v1/message-get' app setting)

or It should be a route path (Routes HTTP GET requests to the specified path '/v1/message-get')?

For example,

test.js**********

var express = require('express');
var app = express();

// in this case, I did not provide callback 
// function after comma (assume, I missed it somehow) 
app.get('/v1/message-get',); 

// this one having a callback
app.get('/v2/message', function(req, res){
 console.log('Call back present');
});

module.exports = app;

'/v2/message' is a valid route but, what about '/v1/message-get'. I know, it is not valid route (as callback function is not provided), but I am not getting any console error on starting node server. is it because app.get('/v1/message-get',) treated as getting app setting for value '/v1/message-get'

Ref: http://expressjs.com/en/api.html#app.get

Thanks

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