serverless-express icon indicating copy to clipboard operation
serverless-express copied to clipboard

NestJS example does not work with root paths

Open keawade opened this issue 3 years ago • 2 comments

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.

keawade avatar Aug 07 '21 18:08 keawade

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

Codysseus121 avatar Jan 18 '22 17:01 Codysseus121

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?

ludgerey avatar Jun 03 '22 18:06 ludgerey