<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Bdet</title>
    <description>The latest articles on DEV Community by Alex Bdet (@alex_bdet).</description>
    <link>https://dev.to/alex_bdet</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F717372%2F83b5f592-c869-4f93-9d34-fb4702c2e552.jpg</url>
      <title>DEV Community: Alex Bdet</title>
      <link>https://dev.to/alex_bdet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alex_bdet"/>
    <language>en</language>
    <item>
      <title>AWS Serverless with NestJS : blank-app</title>
      <dc:creator>Alex Bdet</dc:creator>
      <pubDate>Sat, 02 Oct 2021 13:34:18 +0000</pubDate>
      <link>https://dev.to/alex_bdet/aws-serverless-with-nestjs-blank-app-44af</link>
      <guid>https://dev.to/alex_bdet/aws-serverless-with-nestjs-blank-app-44af</guid>
      <description>&lt;p&gt;Good day !&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Coming home from the Devoxx conference in Paris, the main technology that I wanted to try out and explore was &lt;strong&gt;serverless&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Just to clarify what serverless is in a few words :&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Serverless computing is a method of providing backend services on an as-used basis. Servers are still used, but a company that gets backend services from a serverless vendor is charged based on usage, not a fixed amount of bandwidth or number of servers. (Source : &lt;a href="https://www.cloudflare.com/learning/serverless/what-is-serverless/"&gt;cloudflare&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I've been playing around with NestJS (a NodeJS framework) for some time now and wanted to try building a server using AWS lambda functions using NestJS for the backend of an application.&lt;/p&gt;

&lt;p&gt;To speed up the process and have a nice base to kickstart my projects, I've built a simple &lt;a href="https://github.com/alexbdet/serverless-nestjs-blankapp"&gt;repository&lt;/a&gt; (usable as a template on Github). It contains the barebone structure of a NestJS project and the necessary configuration to deploy it to AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What to expect
&lt;/h3&gt;

&lt;p&gt;This project contains a simple "Hello world!" endpoint, a handler that will be used as our serverless function and a basic serverless.yml file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Prerequisites
&lt;/h4&gt;

&lt;p&gt;You will need an AWS account, and the usual NodeJS development tools (Node, NPM).&lt;/p&gt;

&lt;p&gt;Install the Serverless CLI using &lt;code&gt;npm install -g serverless&lt;/code&gt; and run the &lt;code&gt;aws configure&lt;/code&gt; command to setup your CLI.&lt;/p&gt;

&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/alexbdet/https://github.com/alexbdet/serverless-nestjs-blankapp.git
cd sls-nest-blankapp
npm install
npm run build
sls offline
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hit &lt;a href="http://localhost:3000/dev"&gt;localhost:3000/dev&lt;/a&gt; in your browser and if everything is setup correctly, you should see our lovely "Hello world!". You're all set ! &lt;/p&gt;

&lt;p&gt;&lt;code&gt;sls offline&lt;/code&gt; allows you to run the project locally, if you'd like to deploy the server use :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
sls deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command builds the necessary services to run your server on AWS (API gateway to reach the function, and the lambda function itself). You can use the AWS console to see the details of the built services.&lt;/p&gt;

&lt;p&gt;If you'd like to uninstall your server from AWS and remove the services, use :&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sls remove&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next ?
&lt;/h2&gt;

&lt;p&gt;Check out the &lt;a href="https://docs.nestjs.com/"&gt;NestJS documentation&lt;/a&gt; to get started with this framework, and the &lt;a href="https://www.serverless.com/"&gt;Serverless&lt;/a&gt; website to learn more about the serverless.yml file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thanks !
&lt;/h2&gt;

&lt;p&gt;Thank you for reading, I'd be happy to help out with any questions or fix any problem with the repo should the need arise.&lt;/p&gt;

&lt;p&gt;Have a great day ! &lt;/p&gt;

</description>
      <category>serverless</category>
      <category>nestjs</category>
      <category>node</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
