【问题标题】:Typescript - Unable to access Express Response objectTypescript - 无法访问 Express Response 对象
【发布时间】:2022-12-04 12:47:35
【问题描述】:

I am unable to use the Response object methods in my ts method and when I log it, it is an empty object. Not sure why it is not getting the response from the import

import { Response } from \'express\';
async sendRes(res:Response) {
 res.status(200).send();
}

I get an error that says TypeError: res.status is not a function

    标签: node.js typescript express


    【解决方案1】:
    猜你喜欢
    • 2016-07-02
    • 1970-01-01
    • 2020-05-03
    • 2022-11-11
    • 2014-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-23
    相关资源
    最近更新 更多