taravancil / howsmyhttp

Father stretch my skills pt 1: an exercise in getting better at building and deploying go code by reimplementing other people's stuff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

howsmyhttp

This is the source for howsmyhttp.com.

How's My HTTP tells you which kind of HTTP your client supports. I built this in an effort to practice Go. Inspired by the eminently more useful howsmyssl.

API

TODO document /v1/api

Development

HTML templates, CSS, and JavaScript live in src/. sh/start.sh watches src/ for changes and recompiles the project when the templates change.

Scripts

All scripts live in sh/.

build.sh Runs go build and generates the howsmyhttp binary
start.sh Starts the server, watches src/ and recompiles when the templates change
subset-fonts.sh Generates subset font files from src/fonts/ and outputs them to static/fonts/
gen-certs.sh Generates locally-trusted development certificates

Dependencies

Typography

howsmyhttp uses Verdana, a web-safe font, for all body copy. Nunito is used for headings and decorative text. To reduce the size of font files, all loaded font files are subset to only include the glyphs in use on howsmyhttp.com

Regenerating Subset Font Files

If you add text with glyphs not yet included in the subset font files, you'll need to regenerate them with glyphhanger.

Install glyphanger with npm:

npm i -g glyphhanger

glyphhanger also requires pyftsubset and brotli for generating WOFF2 files. See the installation instructions if you don't already have these installed.

With the local server running, run sh/subset-fonts.sh. The generated font files will be moved to static/fonts. Copy the output @font-face declarations into src/css/fonts.css.

About

Father stretch my skills pt 1: an exercise in getting better at building and deploying go code by reimplementing other people's stuff


Languages

Language:HTML 67.4%Language:CSS 15.3%Language:Go 12.0%Language:Shell 3.1%Language:JavaScript 2.2%