app.get('/user/:field', function(req, res){
console.log(req.params.field);
//.....
Вот рабочий код, если кому нужно будет.
async.each(items, function(item, callback){
var newItem = new Item();
newItem.name = item.name;
newItem.icon_url = item.icon_url;
newItem.icon_url_large = item.icon_url_large;
newItem.type = item.type;
community.getMarketItem(item.appid, item.market_hash_name, function(err, item) {
if(err) throw err;
newItem.lowestPrice = item.lowestPrice;
logger.info('Get price');
newItem.save(function(err) {
if(err) throw err;
logger.info(' New Item saved!');
newBet.item.push(newItem);
callback();
});
});
}, function(err) {
newBet.save(function(err) {
if(err) throw err;
logger.info(' New Bet saved!');
});
});
A simple CLI tool for ensuring that a given script runs continuously (i.e. forever).