How to Use Serverless with NestJS

kop7

mkop

Posted on February 23, 2020

How to Use Serverless with NestJS

Alt Text

Need an example of how to get started with NestJS and Serverless framework?

NestJS is a back-end framework for creating scalable applications.

Getting Started

NestJS

To start playing with NestJS you should have node (version >= 8.9.0) and npm installed. You can download and install Node from the official website.

Create a database automatically

docker run --name mysql57 -p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=superpassword \
-e MYSQL_USER=user \
-e MYSQL_PASSWORD=pass \
-e MYSQL_DATABASE=mydb \
-d mysql/mysql-server:5.7
Enter fullscreen mode Exit fullscreen mode

Serverless framework

For serverless you need to install the required package globally:

npm install serverless -g

To follow this tutorial, you are going to need clone repository NestJS-Serverless-TypeOrm

Now just start application:

npm run sls:offline

Let's create the first author in the application


You can try crud operations on Author

That's it!

Feel free to ask questions, make comments or suggestions, or just say hello in the comments below.

💖 💪 🙅 🚩
kop7
mkop

Posted on February 23, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

How to Use Serverless with NestJS
nestjs How to Use Serverless with NestJS

February 23, 2020