I'm facing a problem with paths in nodeJs, I route the user to the index page when he specifies the language in the url like this :
app.all('/:locale?/index',function(req,res,next){
if(!req.params.locale){
console.log('no param');
res.render('index');
} else {
var language = req.params.locale;
i18n.setLocale(language);
res.render('index');
}
});
However, in my index.html page the source of images are specified this way : ./images/img1.png , when I route the user, my index.html shows image not found because it considers the path " lang/images/img1.png , it considers the languge in my URL, could you please help?
Thank you