oportunidades 8
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-14 08:25:30 +02:00
parent 287e991486
commit ba1c0340ea
9112 changed files with 2199795 additions and 856 deletions
@@ -0,0 +1,24 @@
var http = require('http'),
XML = require('../lib/xml');
var server = http.createServer(function(req, res) {
res.writeHead(200, {"Content-Type": "text/xml"});
var elem = XML.Element({ _attr: { decade: '80s', locale: 'US'} });
var xml = XML({ toys: elem }, {indent:true, stream:true});
res.write('<?xml version="1.0" encoding="utf-8"?>\n');
xml.pipe(res);
process.nextTick(function () {
elem.push({ toy: 'Transformers' });
elem.push({ toy: 'GI Joe' });
elem.push({ toy: [{name:'He-man'}] });
elem.close();
});
});
server.listen(parseInt(process.env.PORT) || 3000);
console.log("server listening on port %d …", server.address().port);