CodeGenieApp / CodeGenieApp/serverless-express

NestJS example does not work with root paths

Open
#443 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
676
PR merge metrics
No merged PRs in 30d

Description

The [starter example for Nest JS](https://github.com/vendia/serverless-express/tree/mainline/examples/basic-starter-nestjs) does not work with root paths.

## Steps to reproduce

```shell
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](https://github.com/vendia/serverless-express/blob/mainline/examples/basic-starter-nestjs/src/app.controller.ts#L8) so it [defaults to the root path for the controller](https://docs.nestjs.com/controllers#routing).

```shell
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:

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

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

The server responds with the expected response.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.