-
simplified Chinese character -
Simplified Chinese English
Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction
[Beijing website production] ToDo website example based on Node.js, Express and Jscex
ToDo website example developed based on Node.js, Express and Jscex
-
exports.index = function (req, res, next) { -
db.query( 'select * from todo order by finished asc, id asc limit 50' , function (err, rows) { -
if (err) return next(err); -
res.render( 'index' , { todos: rows }); -
}); -
};
-
exports.jscexify = function (db) { -
db.queryAsync = function () { -
var _this = this ; -
-
var args = []; -
for ( var i = 0; i < arguments.length; i++) { -
args.push(arguments[i]); -
} -
-
var delegate = { -
onStart: function (callback) { -
-
args.push( function (err, result) { -
if (err) { -
callback( "failure" , err); -
} else { -
callback( "success" , result); -
} -
}); -
-
_this.query.apply(_this, args); -
} -
}; -
-
return new Jscex. Async. Task(delegate); -
} -
}
-
exports.index = toHandler( { -
-
var todos = $await(db.queryAsync( 'select * from todo order by finished asc, id asc limit 50' )); -
res.render( "index" , { todos: todos }); -
-
})));
-
var toHandler = function (asyncFunc) { -
return function (req, res, next) { -
var task = asyncFunc(req, res); -
task.addListener( function () { -
if (task.status == "failed" ) { -
next(task.error); -
} -
}); -
task.start(); -
} -
}
-
> git clone git: //github.com/JeffreyZhao/todo.git -
> cd todo -
> git submodule init -
> git submodule update -
> npm install express ejs mysql -
> node server.js
Station building process
-
Website requirements -
Website planning scheme -
Page design style -
Confirm delivery for use -
Data entry optimization -
Program design and development -
Follow up service -
contact number 010-60259772
Hot tags
-
Website construction -
Food website construction -
WeChat applet development -
Applet development -
Wuxi website construction -
Website construction of research institute -
Shenyang website construction -
Langfang website construction -
Zhengzhou website construction -
Construction of wedding photography website -
Mobile terminal website construction -
University website production -
Tianjin website construction -
Education website construction -
Brand website construction -
Government website construction -
Beijing website construction -
Website Design -
Website production
Latest articles
-
Website construction scheme: Fresh makeup aesthetics website Type: website construction 2025-03-13 -
Enterprise website construction plan: create a new business card for the network and open the digital future Type: website construction 2025-03-11 -
High end website production solution Type: website construction 2025-02-18
Recommended News
-
How to build a better website in Shenzhen? Just do these three things well Many people say that building a website is actually that simple. You don't have to look from here to there. Go ahead and do it 2022-07-02 -
How to set up columns for the website construction of the Academy of Forestry Sciences? I'm glad you have paid attention to the website construction of the Academy of Forestry Sciences! The construction of website columns is an important step, which determines 2024-07-31 -
Interpretation of template website construction and production 1. Select a template for the home page, and then we can start to make it, and the website template will start to be made 2021-08-24 -
What aspects need to be understood in the early stage of website construction design? Recently, we studied some best practices of website design in 2020. Today, we want to see the online 2021-04-10 -
How to seek the development of the local forum of online marketing in the Internet How does the local forum of online marketing seek development in the Internet 2012-12-11 -
How to set up enterprise website 404? It is a common problem that 404 pages appear on the enterprise website, which means that the page visited by the user does not exist or 2024-05-31
Make an appointment with a professional consultant to communicate!
Disclaimer