Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Heroku Engineering 6 min read How-to mediumAdept

Deploying a Simple Go/Gin Application on Heroku

A Go/Gin REST API deploys to Heroku with three files beyond the source: go.mod/go.sum (cleaned with go mod tidy) and a one-line Procfile. The walkthrough covers installing Go 1.24, initializing a module, adding Gin, testing endpoints locally with curl, creating the app with the Heroku CLI, and pushing via the git remote so the Go buildpack compiles the binary. If the service is unreachable after deploy, point the Procfile at the built binary (./bin/go-gin) instead of `go run main.go`, then verify with `heroku logs --tail`.

Assumes: Go modules basicsGit

Related posts

  • How to setup a blog with Hugo and Deno Deploy

    Deno mediumAdept

    A Hugo static site can be published on Deno Deploy by building it in GitHub Actions and serving the generated public directory with Deno's standard-library file server, imported directly by URL with no download or compile step. The walkthrough covers installing Hugo, adding the ananke theme as a git submodule, creating posts, linking a GitHub repo to a Deno Deploy project in GitHub Actions mode, and a complete workflow YAML using peaceiris/actions-hugo and denoland/deployctl. Any static site generator works the same way, since Deno Deploy only needs to serve the built HTML files.

  • Introducing deployctl, the command line interface for Deno Deploy

    Deno mediumAdept

    deployctl is a CLI for managing the full lifecycle of Deno Deploy projects from the terminal: deploying, renaming projects, inspecting deployments, streaming logs, monitoring resource usage with `deployctl top`, promoting preview deployments to production, and deleting deployments or projects. The walkthrough deploys a Hono server and saves its config in deno.json. Because deployments are immutable, changing env vars, domains or the KV database means creating a new deployment, and `redeploy --prod` reuses an existing build to promote it. Piped output is JSON, which makes the CLI scriptable for CI/CD.

  • How to Use pnpm on Heroku

    Heroku Engineering mediumAdept

    Heroku's Node.js buildpack now supports pnpm, and early adopters saw 10-40% faster installs than npm, thanks to pnpm's content-addressable store, symlinked dependencies and overlapping resolve/fetch/link stages. The walkthrough enables Corepack, pins pnpm with an integrity-hashed packageManager field in package.json, and builds a small Express app with a Procfile, then deploys it via git push. A committed pnpm-lock.yaml is required for the buildpack to detect pnpm, and pinning the exact package manager version keeps builds deterministic.

  • Ready, steady, goa: our API setup

    incident.io mediumAdept

    incident.io defines its HTTP API in Goa's design-first DSL, which generates net/http transport handlers, validation code, typed Go service interfaces, OpenAPI 3.0 specs and Go clients. This replaces hand-written Gin handlers with manual parsing, auth and serialization. On top of Goa, a `make generate-api` pipeline pretty-prints and merges the OpenAPI output and filters it into internal, mobile and public variants. Those variants feed specialised clients: typed TypeScript for the React frontend, lean mobile clients and Go test clients. A single DSL change then flows through to server code, docs and compile-time-checked frontend types.

  • The quest for the five minute deploy

    incident.io mediumAdept

    incident.io cut CI/CD times by moving from a hosted provider, where a cold Go build cache made compiling 15,000+ tests across 350+ packages the bottleneck, to Buildkite running on three self-hosted 48-vCPU servers. Prebuilding Ginkgo test binaries and running them in batches on a single server, plus per-server Go build caches, per-yarn.lock Node module caches with pipeline fallback, and local Docker image caches, brought the test step to 2–4 minutes. Production deploys fell from 11.5 to 8.5 minutes, branch builds from 10 to 5.5, and hotfixes to 3.5. Remaining pain points include bin packing containers, under-provisioned disk IOPS, newly exposed flaky tests, cache poisoning, zombie containers, and a fast-growing cache that must be cleared wholesale.

The quest for software engineering knowledge.

Look:
Layout: