diff --git a/src/webserver.js b/src/webserver.js index 860130baca..14640ede4d 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -284,7 +284,7 @@ var express = require('express'), }); break; default : - res.json({}); + res.json(404, { error: 'unrecognized API endpoint' }); break; } } @@ -300,7 +300,7 @@ var express = require('express'), if(data) res.send(data); else - res.send("Category doesn't exist!"); + res.send(404, "Category doesn't exist!"); }); }); @@ -309,7 +309,7 @@ var express = require('express'), if(data) res.send(data); else - res.send("Topic doesn't exist!"); + res.send(404, "Topic doesn't exist!"); }); }); @@ -318,7 +318,7 @@ var express = require('express'), if(data) res.send(data); else - res.send("Post doesn't exist!"); + res.send(404, "Post doesn't exist!"); }); }); @@ -352,4 +352,4 @@ var express = require('express'), }(WebServer)); server.listen(config.port); -global.server = server; \ No newline at end of file +global.server = server;