Skip to content

Demonstration of testing REST API in Golang with Gorilla Mux & PostgreSQL

License

Notifications You must be signed in to change notification settings

agungroyat/go-mux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go REST API Test Example

This repo is the completed code of the tutorial Building and Testing a REST API in Go with Gorilla Mux and PostgreSQL

How to run

Install PostgreSQL with Docker

docker run -it -p 5432:5432 -d postgres

Add environment variables for PostgreSQL connection

Add following lines to ~/.bashrc

export APP_DB_USERNAME=postgres
export APP_DB_PASSWORD=
export APP_DB_NAME=postgres

Run the test

go test -v

or with the following command if you don't want to export the previous variables

APP_DB_USERNAME=postgres APP_DB_PASSWORD= APP_DB_NAME=postgres go test -v

About

Demonstration of testing REST API in Golang with Gorilla Mux & PostgreSQL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages