Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda