I'm a beginner in NodeJs and I came across this problem when I was exporting a module: "TypeError: Can not read property 'get' of undefined" . I did not understand why it gave the error since the code is identical to the one of the course teacher, but still the error occurs. Currently the code looks like this:
module.exports = function(app){
app.get('/noticias', (req, res)=>{
res.render('noticias/noticias')
})
}
When I do the require
of the module the server does not go up, giving this error that I commented. I hope you can help me, thank you right away:)