Building and Testing a REST API in Go with Gorilla Mux and PostgreSQL

1 Year Subscription


This tutorial will illustrate how you can build a REST API backed by PostgreSQL in Go, using Gorilla Mux for routing. The tutorial will employ test-driven development and will conclude by explaining how you can continuously test against a database during development.


By the end of this tutorial, you will:

  • Become familiar with Gorilla Mux, and
  • Learn how to test your application against a database with Continuous Integration (CI).


This tutorial assumes:

  • Basic familiarity with Go and PostgreSQL, and
  • That you have working Go and PostgreSQL installations.

Introduction to the Application

Before we dive into the details, let’s take a brief look at the sample application we will be building as part of this tutorial.

What Will the Application Do?

The application will be a simple REST API server that will expose endpoints to allow accessing and manipulating ‘products’. The operations that our endpoint will allow…


Continue reading on source link

Leave a Comment

Your email address will not be published. Required fields are marked *

+ 87 = 89