获取使用 Lambda 调用 AWS HTTP API 的 URL - Node.js

问题描述

我想为我的待办事项建立一些路线,例如:

  • 列表
  • 获取

因此,为了做到这一点,我想检查调用 API 的 URL(如果有更好的方法请联系我)。我首先在一个简单的 lambda 中尝试,但无法获取 URL,这是我尝试的:

'use strict';

exports.handler = async (event) => {
    
    let itsCallingFrom = event.requestContext.pathParameters;
    
    const response = {
        statusCode: 200,body: JSON.stringify('Calling from: ' + itsCallingFrom),};
    return response;
};

这是我的路线的样子:

/listalltodos
    GET

活动内容如下:

enter image description here

这是我得到的:"Calling from: undefined"

知道如何获得吗?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)