base project

This commit is contained in:
2025-05-02 15:42:14 +02:00
commit ea2b94bf65
3682 changed files with 392213 additions and 0 deletions

26
node_modules/union/examples/after/index.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
var fs = require('fs'),
path = require('path'),
union = require('../../lib');
var server = union.createServer({
before: [ function (req,res) {
if (req.url === "/foo") {
res.text(201, "foo");
}
} ],
after: [
function LoggerStream() {
var stream = new union.ResponseStream();
stream.once("pipe", function (req) {
console.log({res: this.res.statusCode, method: this.req.method});
});
return stream;
}
]
});
server.listen(9080);
console.log('union running on 9080');