Support for reading post bodies from incoming HTTP requests
This commit is contained in:
parent
d1877a890c
commit
074f7f1d35
|
@ -20,6 +20,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@syndicate-lang/core": "^0.0.20",
|
"@syndicate-lang/core": "^0.0.20",
|
||||||
|
"@syndicate-lang/driver-streams-node": "^0.0.2",
|
||||||
"ws": "^6.1.2"
|
"ws": "^6.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import { parse as parseUrl } from "url";
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
const _WebSocket = require('ws');
|
const _WebSocket = require('ws');
|
||||||
|
const S = activate require("@syndicate-lang/driver-streams-node");
|
||||||
|
|
||||||
assertion type HttpServer(host, port);
|
assertion type HttpServer(host, port);
|
||||||
assertion type HttpsServer(host, port, options);
|
assertion type HttpsServer(host, port, options);
|
||||||
|
@ -169,6 +170,7 @@ function _server(host, port, httpsOptions) {
|
||||||
res.writeHead(500, "Internal server error", {});
|
res.writeHead(500, "Internal server error", {});
|
||||||
res.end();
|
res.end();
|
||||||
}
|
}
|
||||||
|
on asserted Observe(S.Readable(id)) react S.readableStreamBehaviour(id, req);
|
||||||
on asserted Response(id, $code, $message, $headers, $detail)
|
on asserted Response(id, $code, $message, $headers, $detail)
|
||||||
{
|
{
|
||||||
res.writeHead(code, message, headers.toJS());
|
res.writeHead(code, message, headers.toJS());
|
||||||
|
|
Loading…
Reference in New Issue