Replace express with native node calls
This commit is contained in:
parent
ad04dd1750
commit
bc359a3a4b
|
|
@ -20,7 +20,8 @@ var server = http.createServer(function(req, res) {
|
||||||
if (!hasSentResult) {
|
if (!hasSentResult) {
|
||||||
hasSentResult = true;
|
hasSentResult = true;
|
||||||
if (errorValue) {
|
if (errorValue) {
|
||||||
res.status(500).send(errorValue);
|
res.statusCode = 500;
|
||||||
|
res.end(errorValue.toString());
|
||||||
} else if (typeof successValue !== 'string') {
|
} else if (typeof successValue !== 'string') {
|
||||||
// Arbitrary object/number/etc - JSON-serialize it
|
// Arbitrary object/number/etc - JSON-serialize it
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue