Change Href Url In All Pages In Javascript Nodejs
I have implemented bootstrap navbar having dropdown with multiple languages, when I select the language, it will translate the page, how to change url for other pages and button te
Solution 1:
It should be possible to "nest" routes with express. (As an example checkout this answer Rest with Express.js nested router)
In your case, I think that would mean that your old code
var languageRouter = require('./routes/language');
app.use('/:lan', languageRouter);
app.use('/:lan/contact', contactusRouter);
app.use('/:lan/aboutus', aboutusRouter);
becomes something like this:
var languageRouter = require('./routes/language');
app.use('/:lan', languageRouter);
languageRouter.use('/:lan/contact', contactusRouter);
languageRouter.use('/:lan/aboutus', aboutusRouter);
Post a Comment for "Change Href Url In All Pages In Javascript Nodejs"