Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!