2 ms·
Similar example in Node const http = require('http'); const url = require('url'); http.createServer((req, res) => { const queryObject = ur
by woutr_be 6y ago
Similar example in Node
const http = require('http');
const url = require('url');
http.createServer((req, res) => {
const queryObject = url.parse(req.url, true).query;
return res.writeHead(200, {
'contentType': 'text/html'
}).end(world(queryObject.depth));
}).listen(8080);
function world(depth = 0) {
return `
<head><title>iframe loop</title></head>
<body><h1>iframe loop ${depth}</h1>
<iframe width="800" height="600" src="/?depth=${parseInt(depth)+1}"></iframe>
</body></html>
`;
}