This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| service: nestjs-serverless-dynamo | |
| plugins: | |
| - serverless-plugin-optimize | |
| - serverless-offline | |
| - serverless-dynamodb-local | |
| functions: | |
| app: | |
| handler: dist/serverless.handler | |
| events: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ExpressAdapter } from '@nestjs/platform-express'; | |
| import { NestFactory } from '@nestjs/core'; | |
| import { AppModule } from './app.module'; | |
| import { Context, Handler } from 'aws-lambda'; | |
| import { INestApplication } from '@nestjs/common'; | |
| import { Express } from 'express'; | |
| import * as express from 'express'; | |
| import { createServer, proxy } from 'aws-serverless-express'; | |
| import { Server } from 'http'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class CreateTodoDto { | |
| title: string; | |
| description: string; | |
| isCompleted?: boolean; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { PartialType } from '@nestjs/mapped-types'; | |
| import { CreateTodoDto } from './create-todo.dto'; | |
| export class UpdateTodoDto extends PartialType(CreateTodoDto) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class Todo { | |
| title: string; | |
| description: string; | |
| isCompleted: boolean; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| Controller, | |
| Get, | |
| Post, | |
| Body, | |
| Patch, | |
| Param, | |
| Delete, | |
| } from '@nestjs/common'; | |
| import { TodosService } from './todos.service'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { DatabaseService } from 'src/db/db.service'; | |
| import { DbModule } from './../db/db.module'; | |
| import { Module } from '@nestjs/common'; | |
| import { TodosService } from './todos.service'; | |
| import { TodosController } from './todos.controller'; | |
| @Module({ | |
| imports: [DbModule], | |
| controllers: [TodosController], | |
| providers: [TodosService, DatabaseService], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { DatabaseService } from 'src/db/db.service'; | |
| import { Injectable, InternalServerErrorException } from '@nestjs/common'; | |
| import { CreateTodoDto } from './dto/create-todo.dto'; | |
| import { UpdateTodoDto } from './dto/update-todo.dto'; | |
| import * as AWS from 'aws-sdk'; | |
| import { v4 as uuid } from 'uuid'; | |
| @Injectable() | |
| export class TodosService { | |
| TABLE_NAME = 'TodosTable'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { DbModule } from './db/db.module'; | |
| import { Module } from '@nestjs/common'; | |
| import { AppController } from './app.controller'; | |
| import { AppService } from './app.service'; | |
| import { TodosModule } from './todos/todos.module'; | |
| @Module({ | |
| imports: [DbModule, TodosModule], | |
| controllers: [AppController], | |
| providers: [AppService], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { DatabaseService } from './db.service'; | |
| import { Global, Module } from '@nestjs/common'; | |
| @Global() | |
| @Module({ | |
| providers: [DatabaseService], | |
| exports: [DatabaseService], | |
| }) | |
| export class DbModule {} |
OlderNewer