Netlify Deploy From CLI - Deploy Your App in Minutes
In this post you will learn what is Netlify service, what pros and cons it has and how to implement Netlify deployment.
So first of all "What is Netlify at all?".
It's a serverless platform so without any knowledge about servers or devops you can deploy your project to production in a matter of seconds.
And two most popular services for this are Vercel and Netlify.
Why Netlify?
Netlify is focused on frontend deployments which means prebuilt Javascript, HTML and CSS. But it also has features to implement to implement backend or work with database.
What is unique about Netlify is that it allows you to create forms for free on the free tier.
Which actually means that you can implement any form for newsletter sending, getting feedback or promoting your service.
And the most important question is pricing and I highly recommend you to use here a free tier.
It really gives you a lot for zero costs. On the free tier where you don't pay anything you are getting 100GB bandwidth and 300 build minutes.
300 build minutes is really a lot. On a normal project like for example React you build time might be 1 minute which means you can deploy your application 300 times in a month.
And as always if you plan to use PRO tear you must really be cautious and check every single line in the description.
After allowed number of request you will pay $55 for every 100GB and it's a lot.
Analytics
The thing that I really don't like about Netlify is that it doesn't give you are analytics on a free tier.
As you can see here it costs additionally $9 per month per site which is actually quite a lot for such a small feature.
Most important
But the most significant feature of Netlify which is really important is that you can build ecommerce on the free tier.
You can start selling something even on the free tier. For example you can implement a blog on the Netlify and you can put there your advertisements. Or you can implement a ecommerce shop and jump later to the paid tier when you are earning significant amount of money.
But for new products and businesses it is extremely important that on Netlify it is possible to earn money on the free tier.
Netlify deploy
With that being said let's look how we can deploy our website to Netlify in a matter of seconds. In my case I want to deploy a todo list application which is created with Angular framework.
As you can see here I can create, edit and remove todos.
So first of all you must create an account on Netlify and install a CLI tool which we will use for deployment.
npm i -g netlify-cli
But you must remember that the correct name of the package is not netlify
but netlify-cli
.
After this we must login
netlify login
It will redirect you to the page where you need to enter your credentials.
After this we can start a deployment
netlify deploy
Here we are getting questions about the teams that you want to select. Just select a default one which you created with your account. After you must provide a site name and most importantly the path of the build files. With angular it must be ./dist/app
We successfully started deployment to production. After deployment we will see a URL where our website is accessible online.
As you can see our project works just like locally.
Want to conquer your next JavaScript interview? Download my FREE PDF - Pass Your JS Interview with Confidence and start preparing for success today!