I am using express
.
I knew there were res.send
, res.render
and res.redirect
methods.
but is there a way to open a new window?
thanks all.
I am using express
.
I knew there were res.send
, res.render
and res.redirect
methods.
but is there a way to open a new window?
thanks all.
ExpressJS is web framework for NodeJS
below functions are used to provide response to incoming request
res.send(), res.render() res.redirect(), res.json(), res.download()
opening a new window in browser is not part of expressJS
you need to use different npm for Headless browser like Puppeteer
example code :
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.goto('https://google.com');
await browser.close();
})();
Note : headless: false
will show you tab open in browser,
This would need to happen on the client side via
window.open("link", "_blank")