A Small Go Server for Static Previews
We wanted a preview server that anyone in the studio could run without installing anything. Go made that easy.
Most of the improvement in a draft comes from cutting. We aim to remove a fifth of every piece on the second pass, and the reader never misses it.
We schedule unstructured time on purpose. Some of our best ideas started as an afternoon with no plan and a stack of old magazines.
package main
import (
"log"
"net/http"
)
func main() {
fs := http.FileServer(http.Dir("./public"))
http.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "public, max-age=60")
fs.ServeHTTP(w, r)
}))
log.Fatal(http.ListenAndServe(":8000", nil))
}
We keep a running document of things that went wrong on past projects. It is not a list of failures so much as a list of warnings, and we read it before every kickoff.
Constraints are underrated. A fixed word count, a single typeface, or a two-colour palette forces decisions that an open brief lets you postpone forever.
Every studio accumulates habits it never chose. Once a year we list them and ask whether each one still earns its place.
Related posts
Shell Aliases That Save Us an Hour a Week
Git, rsync, and image tools, shortened to a few keystrokes.
Writing a Clean WordPress Shortcode
Attributes, escaping, and output buffering done the boring way.
Parsing Markdown Front Matter in Python
Split, parse, and validate the YAML block at the top of a file.
Comments · 9
Such a clear explanation. I finally understand why our pages felt sluggish on mobile.
Such a clear explanation. I finally understand why our pages felt sluggish on mobile.
Small typo in the third paragraph, but otherwise a perfect read with my morning coffee.
Do you have a recommendation for someone just starting out? Everything I find assumes years of experience.
Do you have a recommendation for someone just starting out? Everything I find assumes years of experience.
Would love a follow-up post on how you organise all of this afterwards.
We adopted the no-email-before-ten rule after your last post. Our mornings are so much calmer.
Fair point. We went back and forth on that one in the studio.
This is exactly the nudge I needed this week. Printing the checklist and taping it above my desk.