hands-on lab

Create an API with Go and Gorilla Mux

Difficulty: Intermediate
Duration: Up to 1 hour and 30 minutes
Students: 919
Rating: 4.5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Lab Overview

Go is an open-source programming language that makes it easy to build simple, reliable, and efficient software!

This lab is designed to show you how to install and setup a Go-based development environment, allowing you to compile and execute your own Go-based applications. The lab will then walk you through the process of creating a basic API in which you are shown how to use Gorilla Mux for API request routing.

Lab Objectives

Upon completion of this lab, you will be able to:

  • Install and configure the Go toolset
  • Create and compile basic Go applications
  • Use Gorilla Mux for HTTP routing and URL matching
  • Build basic APIs using Go

You should:

  • Be comfortable with basic software engineering and development principles.

Note: This lab includes a complete solution to consult with when needed.

Lab Environment

This lab will start with the following AWS resources provisioned automatically for you:

  • A single EC2 instance, named ide.cloudacademy.platform.instance, which will have a public IP address attached. This will be the instance that you will connect to using your local workstation browser.

To achieve the lab end state, you will be walked through the process of:

  • Using your local workstation browser to remotely connect to ide.cloudacademy.platform.instance
  • Download, install and configure the Go toolset
  • Create a basic API which leverages the Gorilla Mux package for HTTP routing and URL matching
  • Compile, execute and test the resulting API

Updates:

November 21st, 2024 - Updated Go package, documentation and screenshot

 

Lab steps

Connecting to the CloudAcademy Web based IDE
Install and Configure the Go Tools
Create a Basic HelloWorld Application
Create an API using Go and Gorilla Mux
Test the API