CodeGenieApp / serverless-express

Run Express and other Node.js frameworks on AWS Serverless technologies such as Lambda, API Gateway, Lambda@Edge, and more.
https://codegenie.codes
Apache License 2.0
5.17k stars 671 forks source link

NestJS example does not work with root paths #443

Open keawade opened 3 years ago

keawade commented 3 years ago

The starter example for Nest JS does not work with root paths.

Steps to reproduce

git clone https://github.com/vendia/serverless-express.git
cd serverless-express/examples/basic-starter-nestjs
npm ci

Remove the path from the demo controller's handler so it defaults to the root path for the controller.

npm run sls:offline

Make a request to http://localhost:3000/dev.

The server responds with a 404 error of Cannot GET null.


I have confirmed that this does not occur when using Nest JS without Serverless:

nest new nest-test
cd nest-test
npm run start

Make a request to http://localhost:3000.

The server responds with the expected response.

Codysseus121 commented 2 years ago

Same issue. Not sure if I have missed something. Any idea how or when this is going to be fixed?

ludgerey commented 2 years ago

Having the same problem. Any ideas? I've followed the docs https://docs.nestjs.com/faq/serverless step by step. Except that I've left main.ts as it was a used lambda.ts instead.

Edit: For me it appears to work on aws, but not when using serverless offline, so might be a simulator issue only?