I'm new to node and express and I would appreciate any help. I'm trying to write a get request which checks if the req.params.address_line is empty and does something if it is, but can't seem to figure out how to do that. So far I have tried this:
app.get('/smth/smth_else/:address_line', function(req, res){
if(req.params.address_line===""){
res.send("Hello World.")
}
}
This isn't working though so I don't think it is correct. How can I check if the address_line is empty? I googled it extensively, but can't find a working solution. Thanks!
/smth/smth_else/:address_line?(note the?at the end).