Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

subosito/tiffany

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiffany

Build Status Coverage Status GoDoc

Go vanity URL.

Usage

import "subosito.com/go/tiffany"

For example, you can create a server for your vanity import path:

import (
	"net/http"

	"subosito.com/go/tiffany"
)

func Handler(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Cache-Control", "public, max-age=300")

    tiffany.Render(w, tiffany.Option{
        CanonicalURL: "subosito.com/go/gotenv",
        RepoURL:      "https://github.com/subosito/gotenv",
    })
}

http.Handle("/go/gotenv", Handler)
http.ListenAndServe(":8080", nil)