Help us shape the future of Go! Take the 2026 Go Developer Survey

api

command
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Command api is an example Go API built on the auth module. It serves the Next.js template (templates/nextjs) in development and in its end-to-end tests, and shows how a project wires auth.New.

It prints emails, with their live links, instead of sending them, so it must never be deployed.

Settings, from environment variables:

DATABASE_URL     Postgres connection string (required)
ENCRYPTION_KEY   32 random bytes, base64 (required)
PORT             port to listen on (default 8080)
APP_URL          the web app's URL, for links (default http://localhost:3000)
MAIL_FILE        file to append emails to (default: standard output)
TRUSTED_PROXIES  comma-separated networks allowed to forward the
                 client's IP and user agent (default: loopback)
DISABLE_BREACH_CHECK  "true" skips Have I Been Pwned, for tests that
                 mustn't use the network
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GITHUB_CLIENT_ID,
GITHUB_CLIENT_SECRET  turn on those providers when set

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL