mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Replace express with native node calls
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user