我在 serverless.yml 中定义了以下内容:
functions:
createUser:
handler: src/usersHandler.createOrUpdateUser
events:
- httpApi:
path: /users
method: post
updateUser:
handler: src/usersHandler.createOrUpdateUser
events:
- httpApi:
path: /users/{id}
method: patch
getUser:
handler: src/usersHandler.getUser
events:
- httpApi:
path: /users/{id}
method: get
我可以成功/users/{id}
地从 GET 和 PATCH 端点(/users
我认为这可能与我上面的配置有关,但不确定。