当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Response.send方法代码示例

本文整理汇总了TypeScript中express.Response.send方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Response.send方法的具体用法?TypeScript Response.send怎么用?TypeScript Response.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在express.Response的用法示例。


在下文中一共展示了Response.send方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

export default function(req: Request, res: Response) {
    res.send('Hello world')
}
开发者ID:tinganho,项目名称:api.codemanager.com,代码行数:3,代码来源:install.ts

示例2:

app.use(function (err: any, req: Request, res: Response, next: NextFunction) {
    res.type("text/plain");
    res.status(500);
    res.send("500 - Server Error");
});
开发者ID:JohanBaskovec,项目名称:nodejslibrary,代码行数:5,代码来源:server.ts

示例3:

 app.use((err: any, req: Request, res: Response, next: Function) => {
   LOGGER.error(`Server Error: ${err.message}`);
   LOGGER.error(err.stack);
   res.status(err.status || 500);
   res.send(errorLayout({ version: VERSION, title: 'Error' }, err.message, err));
 });
开发者ID:WuQic,项目名称:pivot,代码行数:6,代码来源:app.ts

示例4:

    .then((rawContent) => {
      const scripts = HAS_WW ? WORKER_SCRIPTS : BROWSER_SCRIPTS;
      const content = rawContent.replace('</body>', scripts + '</body>');

      return res.send(content);
    })
开发者ID:bran921007,项目名称:angular2-starter-kit,代码行数:6,代码来源:ng.ts

示例5: function

 dbo.collection("users").update({"onyen": onyenToUpdate}, {"$set": {"points": points}}, function(err, res2) {
     if (err) throw err;
     var response = JSON.stringify(res2);
     res.send(response);
 });
开发者ID:TeddyRandby,项目名称:ChemistryAgainstHumanity,代码行数:5,代码来源:index.ts

示例6:

 router.get("/admin", (req: Request, res: Response, next: NextFunction) => {
     res.send("You either do not have permission to access this page, or you are trying to access it directly.  If you are an admin, please authenticate and try again.")
 })
开发者ID:TeddyRandby,项目名称:ChemistryAgainstHumanity,代码行数:3,代码来源:index.ts

示例7:

 app.use((err: any, req: Request, res: Response, next: Function) => {
   res.status(err.status || 500);
   res.send(errorLayout({ version: VERSION, title: 'Error' }, err.message, err));
 });
开发者ID:avenger-teamave,项目名称:pivot,代码行数:4,代码来源:app.ts


注:本文中的express.Response.send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。