I want to change my websites title from the app.js file. Is this possible? (I am using node.js and express.js)
Asked
Active
Viewed 157 times
0
-
1Does this answer your question? [How to dynamically change a web page's title?](https://stackoverflow.com/questions/413439/how-to-dynamically-change-a-web-pages-title) – zhulien Mar 16 '21 at 13:06
-
Does this answer your question? [Can I set the "HTML" Title of a PDF file served by my Apache Web server](https://stackoverflow.com/questions/5667576/can-i-set-the-html-title-of-a-pdf-file-served-by-my-apache-web-server) – mousetail Mar 16 '21 at 13:07
1 Answers
0
You can pass the title as an argument inside your route. Is that what you are looking for?
router.get('/', function(req, res, next) {
res.render('index', { title: 'title' });
});

Rendolph
- 433
- 2
- 9