Posts

Writing Go-based function handler for AWS Lambda

Image
 Deploying Go-Based application on AWS Lambda. Introduction Function handlers are a piece of code in an application that is invoked when an event is called. These events are triggers in AWS Lambda which is very well integrated with other AWS services. A trigger can be an API Gateway, an object creation in S3, or an SQS. Tip: If you are new to GoLang, Please visit the below link for a better understanding of Go. A video guide is also attached at the end of the blog The requirement for writing the Go program For executing any GO program, the following steps must be followed. An installation of Go. For installation instructions, see Installing Go . An IDE to edit your code. ( I’ll be using VSCode ) A command terminal. Writing the Lambda function handler code  (you can find the code and build file on my Github ) Create a folder for our project mkdir go-lambda cd go-lambda           2. Create a module file for dependencies. Run the go ...

Getting Started | Infrastructure as Code(IaC) with examples.

Image
                                                                                   Photo by: Nicole De Khors Overview Infrastructure is a vital part of software development. It helps us to create and deploy a software application. Infrastructure can be Servers, load balancers, or DB. The current generation of software development have multiple environments and requires us to create different infrastructure for individual environment. This creates complexity and increases the developer's time to create infrastructure for each environment. The traditional approach for deploying an application was to manually create infrastructure which is a very improper way when it comes to solutions like scalability and reliability. That’s why Infrastructure as ...

Getting Started | Developing an API with Go and Gin

Image
Hello Friends, Today we will understand and write our Go REST API from scratch. We will go through the pre-requisites and later will write the code. Tip : If you are new to Go, Please visit this link to have better understanding of Go. The requirement for running our first RestFul API with GO. For executing any GO program, the following steps must be followed. An installation of Go. For installation instructions, see Installing Go . An IDE to edit your code.   A command terminal.   Creating Go Project Create a folder for our project mkdir go-gin-api cd go-gin-api 2. Create a module file for dependencies. Run the go mod init command, giving it the path of the module your code will be in. go mod init example/go-gin-api This command creates a go.mod file in which dependencies you add will be listed for tracking. 3. create main.go and add the below code and save the file. package main import ( "fmt" "net/http" "github.com/gin-gonic/gin" ) func main() { ...

Hello World! First Golang Program

Image
Hello Friends, Today we will understand and write our Golang code from scratch. We will go through the pre-requisites and later will go through the code. The requirement for running GO. For executing any Go program, the following steps must be followed. We must have Go binaries installed on our machine. for that please follow the steps in the link Writing Hello Go Example Save the below code in the main.go file. package main import "fmt" func main() { fmt.Println("Hello World") } Running the code Run the code by running the below command. go run main.go Understanding the program package is used to tell which component it belongs to. for our example, it is in the main package. import is used to import libraries in the golang. fmt is a go-provided library that helps to spit out output in the command line. fmt.Println() is used to print statements in golang. Thanks for reading. I hope this story was helpful. If you are interested, check out my other articles. y...

Spring Boot Auto reload | Spring Tips-1

Image
 Hello Friends, Today we will understand how spring boot helps us develop our application faster and how it manages application code changes while developing. Tip : If you are new to Spring Boot, Please visit this link to have better understanding of it. Spring Boot helps us to create standalone web applications. This application has an inbuilt web server like tomcat. this feature comes with a drawback at development time. every change you make to your code needs a complete restart of the application. This increases you time required to develop the application, Decreasing productivity.  To overcome this problem Spring Boot came up with devtools. Devtools help us to reload the application whenever there is a code change. this avoids all the restarting efforts and thus increases productivity.  Now that we know what devtools do, let's integrate them into our application. If you are using Spring tool suits you can just right-click the application and add Devtools. ...

Getting Started | Building an Application with Spring Boot

Image
H ello Friends, Today we will understand and write our Spring Boot REST API from scratch. We will go through the pre-requisites and later will write the code.   Tip : If you are new to java, Please visit this link to have better understanding of Java. The requirement for running our first Spring Boot Application. For executing any Spring Boot program, the following steps must be followed. A favorite text editor or IDE. I will be using Eclipse( Spring Tool Suite (STS) )  JDK 1.8 or later Maven 3.2+ Creating Spring Boot Project Navigate to https://start.spring.io/ in your favorite browser. This is spring intializr which helps us to create a skeleton for our application. Add project metadata as you like or you can refer to the screenshot below. Choose either Maven and packaging as jar. Click Dependencies and select Spring Web . Click Generate and a Zip will be downloaded. This will contain all the required files for your project like the main class and pom.xml. unZi...

Hello World! First Java Program

Image
H ello Friends, Today we will be understanding and writing our first java code from scratch. We will go through the pre-requisites and later will go through the code.  The requirement for running Java. For executing any Java program, the following steps must be followed. Install the JDK if you don’t have installed it, download the JDK and install it. Set path of the JDK/bin directory. Visit the link . you can also go through this detailed setup for java . We Won’t be using any IDE like Eclipse or IntelliJ to keep it simple.  Writing Hello Java Example Save the below code in the HelloWorld.java file. class HelloWorld{ public static void main(String args[]){ System.out.println("Hello Java"); } } Compiling and running the code  To Compile the code execute. javac HelloWorld.java Once the file is complied execute the below command to run it. java HelloWorld Understanding the program class keyword is used to declare a class in Java. We h...