Skip to main content

Posts

Showing posts from October, 2020

How to Push Node Js code into Heroku

 Simple native or client side java script can run on browser session can give us the desired output. This can be run either directly on browser if we have all the code on our machine or may be host it on github and can be accessed everywhere without needing to have code on our local machine Github can only run client side javacript code but if we have server side javascript then we may need to use service providers such as heroku/AWS/Google/Azure to run our application Server side coding is done for more complex applications and also not to expose our entire code to the rest of the world For our code to be deployed following are the steps  create. a Procfile with same naming convention and add the following line web: node index.js. This will help the heroku to identify what is the staring JS file on which the code should be run git init git add . git commit -m "version name" heroku create app name . This is to give a specific app name or else heroku would create a name for ou...

How to push git code into a repository with out all node packages

 As am trying to learn node JS, I've learnt that we need a lot of packages to run a web application. Like any web app we would want to push (store) this code in Github. No one wants to have all the projects present in our local machine. Storing data in Github applications will help us to access the code from any where any system. Also we get to choose if we want this application to be public/private In a simple application we would be requiring so many packages eg As we can see they are so many packages and ideally we don't require all this code to be uploaded in Github. As long we have uploaded package.json we can always download these files by using the following command i.e. npm -i install once we download the project from github While uploading the project to github we need to create .gitignore file and enter the filenames which we want not to be uploaded ".gitignore" file is a hidden file For ignoring the node modules enter the following directory Then next steps...

How to use AWS CLI for uploading/downloading/deleting files

 Hello again It's been a lot of time that we have posted here. So let's start with AWS S3 CLI.  We can use AWS CLI for various operations such as Uploading files from local machine into S3 bucket Downloading files from S3 bucket into local machine Listing all the files in a S3 bucket Deleting files from the S3 bucket For all the above operations to be performed we would need relevant access permissions to the specified bucket as well. Apart from permissions the three things which we would need are a) Bucket name b)Access key c) Secret Access key First lets install AWS CLI on our machine. In Mac Installing aws cli curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" sudo installer -pkg AWSCLIV2.pkg -target / In order to test this has worked or not try the simple command aws --version We should get a result in above format Now lets configure for that we need to pass the following command aws configure upon clicking enter it would ask for enter ac...