CodeGenieApp / CodeGenieApp/serverless-express
API Gateway with custom domain and base path returns 404
- 主要语言
- JavaScript
- 星标
- 5.3k
- 派生
- 674
- PR 合并指标
- 30 天内没有已合并 PR
描述
Upgrading from version 3.x to 4.x (Using Koa framework)
Api Gateway + custom domain + base path `job`
Event is coming as :
```
{
"resource": "/{proxy+}",
"path": "/job/status",
...
"pathParameters": {
"proxy": "status"
}
...
}
```
It seems `pathParameters.proxy` value is taken and `ctx.url` is set to `/job` instead of `/job/status` which ends up with 404.
@brett-vendia Is this somehow related to - https://github.com/vendia/serverless-express/blob/4b5ca7a5e90c7709b25b8fada30e13a76ed5c651/src/event-sources/utils.js#L8
Is there any way this stripBasePath to be configurable ?
贡献指南
调研方向
从引用的行开始检查 src/event-sources/utils.js,跟踪在构建 Koa 请求 URL 时如何使用 pathParameters.proxy。使用自定义域名基础路径 `job` 重现所提供的 API Gateway 事件;当 `/job/status` 请求不再返回 404,并且可以按要求配置基础路径剥离行为时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- aws, javascript, node.js
- 领域
- api, backend, cloud
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100