本文整理汇总了TypeScript中express-serve-static-core.Response.send方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Response.send方法的具体用法?TypeScript Response.send怎么用?TypeScript Response.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类express-serve-static-core.Response
的用法示例。
在下文中一共展示了Response.send方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
cmdMap[`${CommandId.cs_startGame}`] = (param)=> {
if (db.game.isGameFinish(param.gameId)) {
res.send({isFinish: true})
}
else {
stagePanelHandle.startGame(param.gameId);
res.send({isFinish: false});
}
return ServerConst.SEND_ASYNC;
};
示例2:
cmdMap[`${CommandId.cs_saveGameRec}`] = (param) => {
if (this.gameInfo.isFinish) {
res.send(false);
}
else {
db.game.saveGameRecToPlayer(this.gameInfo, () => {
});
res.send(true);
}
return ServerConst.SEND_ASYNC;
};
示例3: ScParam
cmdMap[`${CommandId.cs_updatePlayer}`] = (param) => {
var playerId = param.playerId;
var playerIdx = param.idx;
if (this.gameInfo.gameState == GameInfo.GAME_STATE_ING) {
param.playerDoc = db.player.dataMap[playerId];
this.gameInfo.setPlayerInfoByIdx(playerIdx, db.player.getPlayerInfoById(playerId));
db.game.updatePlayerByPos(this.gameInfo.id, playerIdx, playerId);
param.avgEloScore = this.gameInfo.getAvgEloScore();
this.io.emit(`${CommandId.updatePlayer}`, ScParam(param));
return res.send(ScParam(param));
}
};
示例4: function
router.get('/', function(req: Request, res: Response, next: NextFunction) {
res.send({version: '1.0.0'});
});