Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wpkyoto/serverless-lambda-nestjs
https://github.com/wpkyoto/serverless-lambda-nestjs
nestjs
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/wpkyoto/serverless-lambda-nestjs
- Owner: wpkyoto
- License: mit
- Created: 2020-02-27T16:21:57.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-03T01:37:31.000Z (about 2 months ago)
- Last Synced: 2025-01-12T13:13:18.007Z (about 1 month ago)
- Topics: nestjs
- Language: TypeScript
- Homepage: https://hideokamoto.github.io/serverless-lambda-nestjs/
- Size: 2.48 MB
- Stars: 21
- Watchers: 2
- Forks: 5
- Open Issues: 53
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Serverless AWS Lambda Nestjs Adapter
## Badges
[](https://nodei.co/npm/serverless-lambda-nestjs/)
[](https://badge.fury.io/js/serverless-lambda-nestjs)
[](https://opensource.org/licenses/MIT)
[](https://codeclimate.com/github/hideokamoto/serverless-lambda-nestjs/maintainability)
[](https://codeclimate.com/github/hideokamoto/serverless-lambda-nestjs/test_coverage)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fwpkyoto%2Fserverless-lambda-nestjs?ref=badge_small)## Usage
Add it into your Nestjs with AWS Lambda application
```bash
$ npm install -S serverless-lambda-nestjs
```Wrap your Nestjs application by the package.
```typescript
import { APIGatewayProxyHandler } from 'aws-lambda';
import { ServerlessNestjsApplicationFactory } from 'serverless-lambda-nestjs';
// YOUR Nestjs application root module
import { AppModule } from './app.module';export const handler: APIGatewayProxyHandler = async (event, context) => {
const app = new ServerlessNestjsApplicationFactory(
AppModule,
);
const result = await app.run(event, context);
return result;
};export const handler: APIGatewayProxyHandler = async (event, context) => {
const app = new ServerlessNestjsApplicationFactory(
AppModule,
{
// NestFactory.create's option object
cors: true,
},
app => {
// Call additional API from NestFactory.create result
app.enableCors();
return app;
},
);
const result = await app.run(event, context);
return result;
};
```## OGP
```bash
// both
$ yarn run create:ogp// dark
$ yarn run create:ogp:dark// light
$ yarn run create:ogp:light
```

## Prepare
```
$ git clone [email protected]:hideokamoto/serverless-lambda-nestjs.git
$ cd serverless-lambda-nestjs// Put your GitHub Personal Access Token
$ mv .envrc.example .envrc
$ vim .envrc
export CONVENTIONAL_GITHUB_RELEASER_TOKEN=PUT_YOUR_GITHUB_ACCESS_TOKEN// Install
$ yarn
or
$ npm install
```### GitHub Personal Access Token Scope
If the project is private -> `repo`
If the project is public -> `public_repo`## Commit message rule
The repository runs commitlint.
We have to follow "Conventional Commit" to make a commit message.https://www.conventionalcommits.org/en/v1.0.0-beta.4/
```bash
$ git commit -m "[optional scope]:[optional body]
[optional footer]"
```## Contribution
```bash
// clone
$ git clone [email protected]:hideokamoto/serverless-lambda-nestjs.git
$ cd serverless-lambda-nestjs// setup
$ yarn// Unit test
$ yarn test
or
$ yarn run test:watch// Lint
$ yarn run lint
or
$ yarn run lint --fix// Build
$ yarn run build// Rebuild docs
$ yarn run doc
```