Express forum reported an error.

  node.js, question

When using express to build a forum and write and publish articles, I encountered errors. The article is saved to the database and then redirected to the front page. The article can be saved to the database normally, but once published, the server will hang up and the client will report an error:

clipboard.png

Here is my post route:

router.post('/',checkLog,function(req,res,next){
 var newPost = new Post({
 name:req.session.user.name,
 title:req.body.title,
 content:req.body.content
 });
 console.log(newPost);
 newPost.save(function(err,post){
 if(err){
 Log ("publishing failed");
 res.redirect('/post');
 bracket
 Log ('published successfully');
 res.redirect('/');
 });
 });

Post model:

var mongodb = require('./db');
 
 function Post(post){
 this.name = post.name;
 this.title = post.title;
 this.content = post.content;
 bracket
 Post.prototype.save = function(callback){
 var date = new Date();
 var time = {
 date: date,
 year : date.getFullYear(),
 Month: date.getFullYear () plus "-"plus (date.getMonth () plus 1),
 Getfullyear () plus "-"plus (date.getMonth () plus 1) plus "-"plus date.getDate (),
 Minute: date.getFullYear () plus "-"plus (date.getMonth () plus 1) plus "-"plus date.getDate () plus ""
 Get hours () plus ":"plus (date.getHours () < 10?  0' plus date.getminutes (): date.getminutes ())
 };
 var post = {
 name:this.name,
 title:this.title,
 content:this.content,
 time:time
 };
 mongodb.open(function(err,db){
 if(err){
 Log ("Failed to open article database");
 return callback(err);
 bracket
 db.collection("posts",function(err,collection){
 if(err){
 mongodb.close();
 return callback(err);
 bracket
 collection.insert(post,function(err,post){
 if(err){
 mongodb.close();
 return callback(err);
 bracket
 Log ("article successfully saved to database");
 callback(null,post);
 });
 });
 });
 
 };
 Post.get = function(name, callback) {
 //Open the database
 mongodb.open(function (err, db) {
 if (err) {
 return callback(err);
 bracket
 //read posts collection
 db.collection('posts', function(err, collection) {
 if (err) {
 mongodb.close();
 return callback(err);
 bracket
 var query = {};
 if (name) {
 query.name = name;
 bracket
 //query articles based on Query objects
 collection.find(query).sort({
 time: -1
 }).toArray(function (err, docs) {
 mongodb.close();
 if (err) {
 return callback(err);  //Failure!  Return err
 bracket
 callback(null, docs);  //Success!  Returns the results of the query as an array
 });
 });
 });
 };
 /*
 Post.get = function(callback){
 mongodb.open(function(err,db){
 if(err){
 Log ("Failed to open database");
 return callback(err);
 bracket
 db.collection("posts",function(err,collection){
 if(err){
 return callback(err);
 bracket
 collection.find().toArray(function(err,posts){
 if(err){
 return callback(err);
 bracket
 return callback(null,posts);
 });
 });
 });
 };
 */
 module.exports = Post;

Help, thank you!

Is there a display error in the background