Skip to content

heroku-examples/go-gin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go/Gin Quote Service

Simple Go/Gin REST service for storing and retrieving quotes

Deploy

This repository goes along with the blog post Deploying a Simple Go/Gin Appliction on Heroku.

Manual Deployment

Download and install Go

On macOS you can use Homebrew, on other systems you can download the installer from the official Go website.

brew install go

Create your workspace

go mod initi gihub.com/YOUR-USERNAME/YOUR-REPO-NAME

Add the Gin Framework

go get github.com/gin-gonic/gin

Run the server

go run main.go

Create a Heroku App

Login & Create app

heroku login

heroku apps:create my-go-gin-api

Show Git remotes

git remote show heroku

Tidy up your Go project

go mod tidy

Deploying Your Application

Assuming you're in the project directory, git add . works great. Otherwise you might need git add -All.

git add .
git commit -m "Prepare app for Heroku deployment"
git push heroku main 

Test the live application

curl -s -X GET https://<<APP-URL>>/quote | jq

About

Simple Go/Gin REST service for storing and retrieving quotes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •