Skip to content

Commit

Permalink
update log
Browse files Browse the repository at this point in the history
  • Loading branch information
SerinaNya committed Jun 21, 2020
1 parent 9a7de39 commit deba867
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ function onListening() {
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
console.info(`[APP] Listening on ${bind}`);
}
8 changes: 4 additions & 4 deletions routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mongoose.connect(settings.mongodbUrl);
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'Connection error:'));
db.once('open', function () {
console.log(`√ Connected to ${settings.mongodbUrl}`)
console.log(`[DB] Connection established (${settings.mongodbUrl})`)
});
var pasteSchema = mongoose.Schema({
'poster': String,
Expand All @@ -31,10 +31,10 @@ router.get('/paste', function (req, res, next) {
};
if (paste.length == 0) {
res.send({ status: 404 });
return console.error('404 Not Found');
return console.error('Paste Not Found');
};
var responseBody = { status: 200, datas: paste[0] };
console.log(responseBody);
// console.log(responseBody);
res.send(responseBody);
});
});
Expand All @@ -58,7 +58,7 @@ router.post('/paste', (req, res, next) => {
res.send({ status: 500 });
return console.error(err);
};
console.log(result);
// console.log(result);
res.send({ status: 200, datas: result });
});
};
Expand Down

0 comments on commit deba867

Please sign in to comment.