我已将 NestJS 应用发布到 AWS Lambda
当我尝试打开根 URL 时
https://xxx/
正确显示“Hello World”
但是当我打开时:
https://xxx/sales/subscription
显示Missing Authentication Token
消息
有没有人遇到过这种问题?
答案 0 :(得分:0)
我已经解决了这个问题,我在这里分享了解决方案,希望对遇到同样问题的人有所帮助。
因此,显然 Missing Authentication Token
表示该路线不存在。
该应用程序已使用无服务器框架部署到 AWS Lambda。
我通过简单地打开 serverless.yaml
文件解决了这个问题,然后在 functions
部分注册了路由。
之前:
functions:
main: # The name of the lambda function
# The module 'handler' is exported in the file 'src/lambda'
handler: src/lambda.handler
events:
- http:
method: any
path: /
之后:
functions:
main: # The name of the lambda function
# The module 'handler' is exported in the file 'src/lambda'
handler: src/lambda.handler
events:
- http:
method: any
path: /
- http:
method: any
path: /sales/subscription