<?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: Mark Pieszak</title>
    <description>The latest articles on DEV Community by Mark Pieszak (@markpieszak).</description>
    <link>https://dev.to/markpieszak</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%2F190050%2Ffe471d6a-a176-4b05-9729-53dd0bf965f4.jpeg</url>
      <title>DEV Community: Mark Pieszak</title>
      <link>https://dev.to/markpieszak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/markpieszak"/>
    <language>en</language>
    <item>
      <title>Learn how to Deploy NestJS serverless apps to Azure Functions</title>
      <dc:creator>Mark Pieszak</dc:creator>
      <pubDate>Fri, 16 Aug 2019 18:55:38 +0000</pubDate>
      <link>https://dev.to/trilon/learn-how-to-deploy-nestjs-serverless-apps-to-azure-functions-df8</link>
      <guid>https://dev.to/trilon/learn-how-to-deploy-nestjs-serverless-apps-to-azure-functions-df8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Originally published on the &lt;a href="https://trilon.io/blog/deploy-nestjs-azure-functions" rel="noopener noreferrer"&gt;Trilon Blog&lt;/a&gt; by &lt;a href="https://twitter.com/kammysliwiec" rel="noopener noreferrer"&gt;Kamil Mysliwiec&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Deploy NestJS to Production Series:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://trilon.io/blog/deploying-nestjs-to-zeit-now" rel="noopener noreferrer"&gt;Part 1: Deploy NestJS to Zeit Now.sh&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://trilon.io/blog/deploy-nestjs-azure-functions" rel="noopener noreferrer"&gt;&lt;strong&gt;Part 2: Deploy NestJS to Azure Functions&lt;/strong&gt;&lt;/a&gt; &lt;em&gt;(this article)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;... more to come ...&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Serverless NestJS with Microsoft Azure
&lt;/h1&gt;

&lt;p&gt;In this article we'll be looking at how to deploy &lt;em&gt;serverless&lt;/em&gt; &lt;strong&gt;&lt;a href="https://nestjs.com" rel="noopener noreferrer"&gt;NestJS&lt;/a&gt;&lt;/strong&gt; applications to the cloud platform &lt;strong&gt;&lt;a href="https://code.visualstudio.com/tutorials/functions-extension/getting-started" rel="noopener noreferrer"&gt;Azure Functions&lt;/a&gt;&lt;/strong&gt; in only a few minutes!&lt;/p&gt;

&lt;p&gt;If you're not familiar with &lt;strong&gt;&lt;a href="https://nestjs.com" rel="noopener noreferrer"&gt;NestJS&lt;/a&gt;&lt;/strong&gt;, it is a TypeScript Node.js framework that helps you build enterprise-grade efficient and scalable Node.js applications.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Incase you missed the announcement, the integration between NestJS &amp;amp; Azure was &lt;em&gt;just&lt;/em&gt; teased at the other week!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1156143186508730368-230" src="https://platform.twitter.com/embed/Tweet.html?id=1156143186508730368"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1156143186508730368-230');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1156143186508730368&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
Before we dive further, let's take a step back to make sure we have a good understanding about Azure Functions and how they can play a role in handling our serverless NestJS applications.&lt;/p&gt;
&lt;h2&gt;
  
  
  What are Azure Functions ?
&lt;/h2&gt;

&lt;p&gt;Azure Functions are a serverless computing execution service that enables you to run code &lt;em&gt;on-demand&lt;/em&gt; without having to manage the allocation of machine resources, servers, etc. Write your NestJS code, deploy it - and let Azure Functions handle the rest!&lt;/p&gt;

&lt;p&gt;Azure functions can let you create functions that execute &lt;strong&gt;based on events&lt;/strong&gt;, read more in the official Azure Functions documentation &lt;a href="https://docs.microsoft.com/azure/azure-functions/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;



&lt;p&gt;Azure let's you deploy a myriad of different frameworks/languages, from C# to JavaScript/TypeScript.&lt;/p&gt;

&lt;p&gt;NestJS is a TypeScript-based Node.js framework after all - so let's take a look at how we utilize the fantastic Azure platform to deploy our serverless applications!&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting NestJS setup
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In this demonstration, we'll be showcasing a new NestJS application generated by the CLI, but if you prefer to use an existing NestJS application - feel free - and to skip ahead to the next section about Schematics.&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;☁ npm i &lt;span class="nt"&gt;-g&lt;/span&gt; @nestjs/cli
☁ nest new PROJECT_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's &lt;code&gt;cd&lt;/code&gt; into the newly created directory and open up our IDE. At this point we have a simple generated NestJS Application.&lt;/p&gt;




&lt;h1&gt;
  
  
  📯 Introducing NestJS Azure Functions Schematics
&lt;/h1&gt;

&lt;p&gt;At &lt;strong&gt;&lt;a href="https://trilon.io" rel="noopener noreferrer"&gt;Trilon&lt;/a&gt;&lt;/strong&gt;, we've been working with some amazing individuals over on the Microsoft Azure team to create a seamless integration between NestJS + Azure Functions. Allowing you to effortlessly deploy your new/existing services to the cloud!&lt;/p&gt;

&lt;p&gt;These NestJS schematics allow you to instantly setup your application with all the scaffolding required for the integration, with one simple command. More on this later!&lt;/p&gt;

&lt;h1&gt;
  
  
  Installing NestJS Azure Functions Schematics
&lt;/h1&gt;

&lt;p&gt;In your terminal, make sure you're at the root directory of your project and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;nest&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;nestjs&lt;/span&gt;&lt;span class="sr"&gt;/azure-func-htt&lt;/span&gt;&lt;span class="err"&gt;p
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;✔ Installation &lt;span class="k"&gt;in &lt;/span&gt;progress... ☕
CREATE /.funcignore &lt;span class="o"&gt;(&lt;/span&gt;66 bytes&lt;span class="o"&gt;)&lt;/span&gt;
CREATE /host.json &lt;span class="o"&gt;(&lt;/span&gt;23 bytes&lt;span class="o"&gt;)&lt;/span&gt;
CREATE /local.settings.json &lt;span class="o"&gt;(&lt;/span&gt;116 bytes&lt;span class="o"&gt;)&lt;/span&gt;
CREATE /proxies.json &lt;span class="o"&gt;(&lt;/span&gt;72 bytes&lt;span class="o"&gt;)&lt;/span&gt;
CREATE /main/function.json &lt;span class="o"&gt;(&lt;/span&gt;294 bytes&lt;span class="o"&gt;)&lt;/span&gt;
CREATE /main/index.ts &lt;span class="o"&gt;(&lt;/span&gt;287 bytes&lt;span class="o"&gt;)&lt;/span&gt;
CREATE /main/sample.dat &lt;span class="o"&gt;(&lt;/span&gt;23 bytes&lt;span class="o"&gt;)&lt;/span&gt;
CREATE /src/main.azure.ts &lt;span class="o"&gt;(&lt;/span&gt;321 bytes&lt;span class="o"&gt;)&lt;/span&gt;
UPDATE /package.json &lt;span class="o"&gt;(&lt;/span&gt;1827 bytes&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Excellent!&lt;/strong&gt; You now have your NestJS application completely setup for Azure Functions! What's next?&lt;/p&gt;




&lt;h2&gt;
  
  
  Local Azure Functions development
&lt;/h2&gt;

&lt;p&gt;Next, we're going to utilize the Azure-CLI to test our Azure Functions locally!&lt;/p&gt;

&lt;p&gt;If you don't have it installed on your machine yet, make sure to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;a href="https://docs.microsoft.com/azure/azure-functions/functions-run-local#v2" rel="noopener noreferrer"&gt;Azure Functions Core Tools&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install the &lt;a href="https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest" rel="noopener noreferrer"&gt;Azure CLI&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you have everything installed, make sure it was setup right by entering &lt;code&gt;func --version&lt;/code&gt; in your terminal.&lt;/p&gt;




&lt;p&gt;With the Azure-CLI all setup, let's fire up our &lt;em&gt;Local&lt;/em&gt; Azure Functions environment and see everything in action!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; Build NestJS first. Since it's written in TypeScript we need to make sure our application compiles down to JavaScript before letting Azure do the rest!&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; func host start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should output something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Hosting environment: Production
Content root path: /Users/yourname/Documents/Trilon/nestjs-azure-functions
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.

Http Functions:

    main:  http://localhost:7071/api/&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt;segments&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h4&gt;
  
  
  Open up that url &lt;code&gt;http://localhost:7071/api/&lt;/code&gt; in your browser you should see:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm1equa78t9lgr7w4oi3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm1equa78t9lgr7w4oi3m.png" alt="NestJS Azure Functions local development"&gt;&lt;/a&gt;NestJS &amp;amp; Azure functions local development&lt;/p&gt;

&lt;h3&gt;
  
  
  It's that easy!
&lt;/h3&gt;

&lt;p&gt;If you're wondering why the URL is prepended with &lt;code&gt;/api/&lt;/code&gt;, take a look at your &lt;code&gt;main.azure.ts&lt;/code&gt; file in the NestJS project. You could update it to whatever you wish, add API versioning (&lt;code&gt;/api/v1/&lt;/code&gt;), etc!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff3g0w6o8eaknaz5xvllo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff3g0w6o8eaknaz5xvllo.png" alt="NestJS globalPrefix"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Eventually a real-world application would have all of the URLs all available under this globalPrefix.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ie:&lt;/span&gt;
GET /api/products/
GET /api/products/123
POST /api/products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Deploying NestJS to Azure Functions
&lt;/h1&gt;

&lt;p&gt;Stay tuned for future announcements as we will be introducing &lt;code&gt;nest deploy azure&lt;/code&gt; and other great integrations that will simplify this process even further!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: To deploy Azure Functions, you'll need an &lt;a href="https://azure.microsoft.com/free/" rel="noopener noreferrer"&gt;Azure Account&lt;/a&gt; (new accounts get 12 months of free services).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When it comes to Deploying your NestJS app to Azure Functions, there are a few different paths you could take, and it all depends on whether you prefer doing everything in the &lt;code&gt;terminal&lt;/code&gt; or your &lt;strong&gt;IDE&lt;/strong&gt; (ie: VSCode).&lt;/p&gt;

&lt;p&gt;In this article we're going to showcase deploying via VSCode as it's a bit simpler! Read more about deploying via the &lt;code&gt;terminal&lt;/code&gt; from the official Azure documentation &lt;a href="https://docs.microsoft.com/azure/azure-functions/functions-create-first-azure-function-azure-cli#create-a-resource-group" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install the Azure Functions VSCode Extension
&lt;/h2&gt;

&lt;p&gt;Head over to the Extensions Marketplace in VSCode and search for &lt;code&gt;"Azure Functions"&lt;/code&gt; or download it &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;More information on the extension installation and prerequisites &lt;a href="https://code.visualstudio.com/tutorials/functions-extension/getting-started" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq3150mqwek6eafmq2gpc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq3150mqwek6eafmq2gpc.png" alt="VSCode Extensions - Install Azure Functions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once installed, you'll notice a new &lt;strong&gt;Icon&lt;/strong&gt; on the &lt;em&gt;left-hand&lt;/em&gt; sidebar, select it to open up the Azure Functions options.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Login or Signup (to Azure)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5894y83ebngo6lsdfux5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5894y83ebngo6lsdfux5.png" alt="VSCode Extension - Azure Functions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Hit the "Deploy to Function App" **Arrow&lt;/strong&gt; icon, and select "Create New Function App in Azure".**&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frbieelzu71n5oisosusl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frbieelzu71n5oisosusl.png" alt="VSCode Extension - Azure Functions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Select a unique name for your Azure Function, and press Enter.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: This step may take a few moments as it will be creating Storage Groups, and your new Function App. Future deployments will be much faster, not to worry! :)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq0ddxsu6xr29clehb34c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fq0ddxsu6xr29clehb34c.png" alt="Deploying Azure Function"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Deployed!
&lt;/h4&gt;

&lt;p&gt;When everything is finished, check in the &lt;code&gt;Output&lt;/code&gt; tab (shown above) that your deployment has been finished!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# --- output similar to ---&lt;/span&gt;
&lt;span class="c"&gt;# ... etc etc ...&lt;/span&gt;
1:54:52 PM nestjs-azure-demo: Deployment successful.
1:55:08 PM nestjs-azure-demo: Waiting &lt;span class="k"&gt;for &lt;/span&gt;long running &lt;span class="nb"&gt;command &lt;/span&gt;to finish...
Deployment to &lt;span class="s2"&gt;"nestjs-azure-demo"&lt;/span&gt; completed.

HTTP Trigger Urls:
  main: https://nestjs-azure-demo.azurewebsites.net/api/%7B&lt;span class="k"&gt;*&lt;/span&gt;segments%7D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Serverless NestJS deployed to the ☁ !
&lt;/h1&gt;

&lt;p&gt;If you've been following along, you should be able to access that URL in your output tab, just make sure to remove the last &lt;code&gt;%7B*segments%7D&lt;/code&gt; portion of the URL.&lt;/p&gt;

&lt;p&gt;🐱 Navigate to the URL to see your serverless "Hello World" API in all its eternal glory! 🐱&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6ckwu3xbu4j12ulk3cw9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F6ckwu3xbu4j12ulk3cw9.png" alt="Deploy NestJS to Azure Function live demo"&gt;&lt;/a&gt;&lt;/p&gt;
Magical ✨



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;See the "Hello World" NestJS + Azure Functions live demo:&lt;br&gt; &lt;a href="https://nestjs-azure-demo.azurewebsites.net/api" rel="noopener noreferrer"&gt;https://nestjs-azure-demo.azurewebsites.net/api&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;You can find the Github code example &lt;a href="https://github.com/TrilonIO/nestjs-azure-functions" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  There we have it!
&lt;/h2&gt;

&lt;p&gt;In just a few minutes, we fired up azure functions locally, and learned how to deploy with the new VSCode Azure Functions Extension, taking our serverless NestJS application to the cloud in no time!&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Plans for NestJS &amp;amp; Azure ✨
&lt;/h2&gt;

&lt;p&gt;It's our mission to make this entire process even simpler in the future!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Stay tuned for more articles and updates on the upcoming &lt;code&gt;nest deploy azure&lt;/code&gt;, and other amazing Azure integrations! ✨&lt;/strong&gt; &lt;br&gt;&lt;br&gt;Azure Storage, improved serverless support, and much more!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  In Conclusion
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Azure Functions let you deploy your NestJS applications to the cloud with ease, letting you use all of your other favorite Azure tools from within your application.&lt;/li&gt;
&lt;li&gt;Make sure your scripts are building your NestJS &lt;em&gt;before&lt;/em&gt; deploying.&lt;/li&gt;
&lt;li&gt;Deploy through either the command-line or through IDE Extensions&lt;/li&gt;
&lt;li&gt;More NestJS &amp;amp; Azure integrations coming soon!&lt;/li&gt;
&lt;li&gt;Enjoy the ☁ responsibly!&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Check out the &lt;a href="https://trilon.io/blog" rel="noopener noreferrer"&gt;Trilon Blog&lt;/a&gt; for more articles on Angular, NestJS, and much more!&lt;/p&gt;




</description>
      <category>webdev</category>
      <category>node</category>
      <category>nestjs</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to delete ALL node_modules folders on your machine and free up HD space!</title>
      <dc:creator>Mark Pieszak</dc:creator>
      <pubDate>Wed, 07 Aug 2019 18:16:01 +0000</pubDate>
      <link>https://dev.to/trilon/how-to-delete-all-nodemodules-folders-on-your-machine-43dh</link>
      <guid>https://dev.to/trilon/how-to-delete-all-nodemodules-folders-on-your-machine-43dh</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Originally published on the &lt;strong&gt;&lt;a href="https://trilon.io/blog/how-to-delete-all-nodemodules-recursively" rel="noopener noreferrer"&gt;Trilon Blog&lt;/a&gt;&lt;/strong&gt; on Aug 7, 2019.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Whenever we work on a new project we need to run &lt;code&gt;npm install&lt;/code&gt;, but how often do we think about the toll this takes on our hard-drive?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcnorkdsd8nmcse1erid7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcnorkdsd8nmcse1erid7.png"&gt;&lt;/a&gt;&lt;/p&gt;
The dreaded "out of space" message



&lt;p&gt;A single node_modules folder can take up anywhere from 200+ megabytes of space (sometimes 1GB+ !).&lt;/p&gt;

&lt;p&gt;Now take a look at your &lt;code&gt;github/&lt;/code&gt; folder, or wherever else you're storing the majority of your projects, and you can start to see where &lt;em&gt;some&lt;/em&gt; of your free hard-drive space has gone!&lt;/p&gt;

&lt;p&gt;I recently tweeted about this, as it's something I use every few months and wanted to share with others who might have ran into the same situation themselves!&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1159136343559155712-529" src="https://platform.twitter.com/embed/Tweet.html?id=1159136343559155712"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1159136343559155712-529');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1159136343559155712&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;h2&gt;
  
  
  List all node_modules found in a Directory:
&lt;/h2&gt;

&lt;p&gt;First, let's take a look at &lt;em&gt;ALL&lt;/em&gt; the node_modules we have in a directory, before we actually start deleting them!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Make sure you cd into a specific directory where most of your projects are. ie: &lt;code&gt;documents&lt;/code&gt; or &lt;code&gt;documents/github&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Mac / Linux:
&lt;/h3&gt;

&lt;p&gt;This command will print out each folder, and even show us how much space the folder is occupying ! Thanks to &lt;a href="https://dev.to/rhymes/comment/dpci"&gt;Rhymes&lt;/a&gt; for the tip!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;documents
&lt;span class="nv"&gt;$ &lt;/span&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-prune&lt;/span&gt; &lt;span class="nt"&gt;-print&lt;/span&gt; | xargs &lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-chs&lt;/span&gt;

&lt;span class="nt"&gt;---&lt;/span&gt; Example output &lt;span class="nt"&gt;---&lt;/span&gt;
1.0G ./Github/big-project/node_modules
225M ./Github/Trilon.io/node_modules
482M ./Github/Some_Demo/node_modules

1.7G total
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Windows:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;documents
&lt;span class="nv"&gt;$ &lt;/span&gt;FOR /d /r &lt;span class="nb"&gt;.&lt;/span&gt; %d &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;node_modules&lt;span class="o"&gt;)&lt;/span&gt; DO @IF EXIST &lt;span class="s2"&gt;"%d"&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; %d&lt;span class="s2"&gt;"
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This list will give you a good idea of just the sheer amount of projects you have installed on your machine!&lt;/p&gt;




&lt;h2&gt;
  
  
  Delete all node_modules found in a Directory:
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Use caution here, and make sure that you are in a directory where you're comfortable removing &lt;em&gt;all&lt;/em&gt; the instances of node_modules, run the script above to see a full list of them all before deleting.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This script is actually very similar to the one above, but we're going to be utilizing &lt;code&gt;rm -rf&lt;/code&gt; to completely delete them.&lt;/p&gt;

&lt;blockquote&gt; &lt;strong&gt;WARNING:&lt;/strong&gt; This process is irreversible!&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Mac / Linux:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;documents
&lt;span class="nv"&gt;$ &lt;/span&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s1"&gt;'node_modules'&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d &lt;span class="nt"&gt;-prune&lt;/span&gt; &lt;span class="nt"&gt;-print&lt;/span&gt; &lt;span class="nt"&gt;-exec&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; &lt;span class="s1"&gt;'{}'&lt;/span&gt; &lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Windows:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;documents
&lt;span class="nv"&gt;$ &lt;/span&gt;FOR /d /r &lt;span class="nb"&gt;.&lt;/span&gt; %d &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;node_modules&lt;span class="o"&gt;)&lt;/span&gt; DO @IF EXIST &lt;span class="s2"&gt;"%d"&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; &lt;span class="s2"&gt;"%d"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Powershell Users:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Get-ChildItem &lt;span class="nt"&gt;-Path&lt;/span&gt; &lt;span class="s2"&gt;"."&lt;/span&gt; &lt;span class="nt"&gt;-Include&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt; &lt;span class="nt"&gt;-Recurse&lt;/span&gt; &lt;span class="nt"&gt;-Directory&lt;/span&gt; | Remove-Item &lt;span class="nt"&gt;-Recurse&lt;/span&gt; &lt;span class="nt"&gt;-Force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  There we have it!
&lt;/h3&gt;

&lt;p&gt;For me personally, this typically clears out about 40-60GB from my hard-drive, but your mileage may vary!&lt;/p&gt;

&lt;h2&gt;
  
  
  In Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Make sure to list all node_modules in a given directory &lt;em&gt;BEFORE&lt;/em&gt; deleting them.&lt;/li&gt;
&lt;li&gt;Make sure to be cautious as this process is &lt;em&gt;irreversible&lt;/em&gt;!&lt;/li&gt;
&lt;li&gt;Remember to &lt;code&gt;npm install&lt;/code&gt; on the projects you need to work on again.&lt;/li&gt;
&lt;li&gt;Enjoy the free space! :)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Comment below I'd love to hear how much you saved!
&lt;/h3&gt;

&lt;p&gt;Also, don't forget to check out the &lt;a href="https://trilon.io/blog" rel="noopener noreferrer"&gt;Trilon Blog&lt;/a&gt; for more in-depth articles!&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Deploying NestJS Apps to the cloud with Zeit Now in 2 minutes!</title>
      <dc:creator>Mark Pieszak</dc:creator>
      <pubDate>Wed, 17 Jul 2019 19:45:34 +0000</pubDate>
      <link>https://dev.to/trilon/deploying-nestjs-apps-to-the-cloud-with-zeit-now-1jc4</link>
      <guid>https://dev.to/trilon/deploying-nestjs-apps-to-the-cloud-with-zeit-now-1jc4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Originally published on the &lt;a href="https://trilon.io/blog/deploying-nestjs-to-zeit-now" rel="noopener noreferrer"&gt;Trilon Blog&lt;/a&gt; by &lt;a href="https://twitter.com/MarkPieszak" rel="noopener noreferrer"&gt;Mark Pieszak&lt;/a&gt;&lt;/strong&gt; &lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Deploy NestJS to Production Series:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://trilon.io/blog/deploying-nestjs-to-zeit-now" rel="noopener noreferrer"&gt;&lt;strong&gt;Part 1: Deploy NestJS to Zeit Now.sh&lt;/strong&gt;&lt;/a&gt; &lt;em&gt;(this article)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://trilon.io/blog/deploy-nestjs-azure-functions" rel="noopener noreferrer"&gt;Part 2: Deploy NestJS to Azure Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;... more to come ...&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What are we trying to achieve?
&lt;/h2&gt;

&lt;p&gt;In this article we'll be looking at how to deploy &lt;strong&gt;&lt;a href="https://nestjs.com" rel="noopener noreferrer"&gt;NestJS&lt;/a&gt;&lt;/strong&gt; applications to the cloud platform &lt;strong&gt;&lt;a href="https://zeit.co/now" rel="noopener noreferrer"&gt;Zeit Now&lt;/a&gt;&lt;/strong&gt; in only a few minutes!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;See the "Hello World" NestJS + Zeit Now live demo:&lt;br&gt; &lt;a href="https://NestJS-Zeit.Now.sh/" rel="noopener noreferrer"&gt;NestJS-Zeit.Now.sh&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;You can find the Github code example &lt;a href="https://github.com/TrilonIO/zeit-now-nestjs" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  What is Zeit "Now" ?
&lt;/h1&gt;

&lt;p&gt;Zeit &lt;strong&gt;Now&lt;/strong&gt; is a cloud platform for serverless deployment.&lt;br&gt;
It's an incredibly simple, easy to use platform that allows you to deploy anything from&lt;br&gt;
static websites to server/serverless application instantly, scale automatically, all with minimal configuration.&lt;/p&gt;

&lt;p&gt;This includes front-end applications (Angular/React/Vue/etc), or any backend of your choosing - Go, Node.js, Python and everything in-between!&lt;/p&gt;

&lt;p&gt;NestJS is a Node.js framework after all, so how can we take advantage of an incredible Cloud platform like &lt;strong&gt;Now&lt;/strong&gt;, and deploy our applications ?&lt;/p&gt;
&lt;h1&gt;
  
  
  Getting setup
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In this demonstration, we'll be showcasing a new NestJS application generated by the CLI, but if you prefer to use an existing NestJS application - feel free - and just skip ahead !&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Generate a new NestJS Application
&lt;/h2&gt;

&lt;p&gt;For demo purposes, let's make sure we have the latest NestJS CLI installed - and create a New application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;☁ npm i &lt;span class="nt"&gt;-g&lt;/span&gt; @nestjs/cli
☁ nest new PROJECT_NAME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's &lt;code&gt;cd&lt;/code&gt; into the newly created directory and open up our IDE. At this point we have a simple generated NestJS Application.&lt;/p&gt;

&lt;h1&gt;
  
  
  Setting up Zeit Now
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install the Now CLI&lt;/span&gt;
☁ npm i &lt;span class="nt"&gt;-g&lt;/span&gt; now
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you're logged into the Now CLI (or &lt;a href="https://zeit.co/login" rel="noopener noreferrer"&gt;create an account&lt;/a&gt; before logging in).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;☁ now login
&lt;span class="c"&gt;# enter email &amp;amp; password&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok great! We have a "hello world" NestJS application &amp;amp; &lt;strong&gt;Now&lt;/strong&gt; setup, where do we go from here?&lt;/p&gt;




&lt;h1&gt;
  
  
  Configuring Zeit Now for NestJS
&lt;/h1&gt;

&lt;p&gt;Typically with &lt;strong&gt;Now&lt;/strong&gt;, deployments are as simple as typing &lt;code&gt;now&lt;/code&gt; in your terminal.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;But that alone won't work for our NestJS application.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Now&lt;/strong&gt; lets you configure your &lt;a href="https://zeit.co/docs/v2/deployments/configuration/?query=now.json" rel="noopener noreferrer"&gt;Deployment Configuration&lt;/a&gt; via a &lt;strong&gt;&lt;code&gt;now.json&lt;/code&gt;&lt;/strong&gt; file (typically found in the root of a project).&lt;/p&gt;

&lt;h1&gt;
  
  
  Now.json configuration
&lt;/h1&gt;

&lt;p&gt;With this &lt;code&gt;now.json&lt;/code&gt; configuration file, we can control many aspects of our deployment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deployment / Project Name&lt;/li&gt;
&lt;li&gt;Aliases (ie: your domain URL)&lt;/li&gt;
&lt;li&gt;Build setup&lt;/li&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Serving static assets&lt;/li&gt;
&lt;li&gt;&lt;a href="https://zeit.co/docs/v2/deployments/configuration/?query=now.json" rel="noopener noreferrer"&gt;much more...&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the root of your application, create a &lt;strong&gt;&lt;code&gt;now.json&lt;/code&gt;&lt;/strong&gt; file and add the JSON code below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Note: You can set &lt;code&gt;name&lt;/code&gt; below to whatever you would like
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"nestjs-now"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"builds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist/main.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"use"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"@now/node"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"routes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/(.*)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"dest"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dist/main.js"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What is this configuration doing?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Builds&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On the line &lt;strong&gt;&lt;code&gt;"use": "@now/node"&lt;/code&gt;&lt;/strong&gt;, we are telling the Now builder to take the file &lt;code&gt;dist/main.js&lt;/code&gt; as an entry point for a Node.js function, building its dependencies, and bundling them into a &lt;a href="https://zeit.co/docs/v2/deployments/concepts/lambdas/" rel="noopener noreferrer"&gt;Lambda&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Let's remember that at the end of the day, NestJS compiles down to JavaScript and runs like a standard Node.js server&lt;/li&gt;
&lt;li&gt;By default NestJS is using Express behind the scenes, but it can optionally be switched to use Fastify.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;More info on @now/node &lt;a href="https://zeit.co/docs/v2/deployments/official-builders/node-js-now-node/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Routes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We want to make sure that &lt;em&gt;all&lt;/em&gt; routing &lt;code&gt;/(.*)&lt;/code&gt; is handling by the API routes we setup within our NestJS application, so we're just telling Now where our main file is.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;More info on &lt;strong&gt;Now&lt;/strong&gt; routes &lt;a href="https://zeit.co/docs/v2/deployments/routes/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h1&gt;
  
  
  Building &amp;amp; Deploying
&lt;/h1&gt;

&lt;p&gt;Now that we have everything setup - let's Deploy it to &lt;strong&gt;Now&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;NestJS is a TypeScript-based Node.js framework, so we're going to need to make sure we build it for Production (via &lt;code&gt;npm run build&lt;/code&gt;) and then we can let &lt;strong&gt;Now&lt;/strong&gt; do its thing (via &lt;code&gt;now&lt;/code&gt;) !!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;☁ npm run build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; now

&lt;span class="c"&gt;# ---------------------&lt;/span&gt;
&lt;span class="c"&gt;#    example output&lt;/span&gt;
&lt;span class="c"&gt;# ---------------------&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; zeit-now-nestjs@0.0.1 build /Users/Documents/Trilon/zeit-now-nestjs
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; tsc &lt;span class="nt"&gt;-p&lt;/span&gt; tsconfig.build.json

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Deploying ~/Documents/Trilon/zeit-now-nestjs under trilon-io
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Using project nestjs-now
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Synced 2 files &lt;span class="o"&gt;(&lt;/span&gt;462.27KB&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;2s]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; https://nestjs-zeit.now.sh/ &lt;span class="o"&gt;[&lt;/span&gt;v2] &lt;span class="o"&gt;[&lt;/span&gt;928ms]
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Ready! Aliased to https://nestjs-zeit.now.sh/ &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="k"&gt;in &lt;/span&gt;clipboard] &lt;span class="o"&gt;[&lt;/span&gt;43s]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  NestJS deployed to the ☁ !
&lt;/h1&gt;

&lt;p&gt;If you look above (or in your terminal if you're following along), we can see there was a URL outputted in the terminal! It was automatically copied to our clipboard, so go ahead and open up a Browser and take a look!!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Hello World" in all of its magical glory...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F76n6xmfotb7f7r6wbqgh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F76n6xmfotb7f7r6wbqgh.png" alt="NestJS Zeit Now deployment example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Inspecting the page itself we can see that it was infact served up by an Express server, just as a default NestJS application is setup to do!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  There we have it!
&lt;/h1&gt;

&lt;p&gt;In just a few minutes and one small &lt;code&gt;json&lt;/code&gt; file - we took our NestJS application to the cloud with Zeit &lt;strong&gt;Now&lt;/strong&gt;!&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;See the "Hello World" NestJS + Zeit Now live demo:&lt;br&gt; &lt;a href="https://NestJS-Zeit.Now.sh/" rel="noopener noreferrer"&gt;NestJS-Zeit.Now.sh&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;You can find the Github code example &lt;a href="https://github.com/TrilonIO/zeit-now-nestjs" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  In Conclusion
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Now&lt;/strong&gt; makes deploying our NestJS applications to the cloud even simpler.&lt;/li&gt;
&lt;li&gt;Make sure your scripts are building your NestJS &lt;em&gt;before&lt;/em&gt; deploying.&lt;/li&gt;
&lt;li&gt;Setup your &lt;code&gt;now.json&lt;/code&gt; to be configured for NestJS builds.&lt;/li&gt;
&lt;li&gt;Enjoy the ☁ responsibly!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nestjs</category>
      <category>node</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
