The Breakroom

WorldWideWeb, Part II

June 2, 2022

By Craig Hockenberry

The Mac and Web have a long history together. From the very beginning, Mac OS X included the ability to run an Apache web server by clicking a Start button:

A screenshot of Sharing preferences in Mac OS X 10.0
Sharing preferences in Mac OS X 10.0. Courtesy

About a decade ago, things started to change. Since then it’s gotten harder and harder to start a simple web server for testing HTML, CSS, and JavaScript. I eventually found a way to do it using AppleScript, but as Apple continues to remove open source components from its standard macOS distribution, this workaround isn’t likely to last.

So I decided to write my own web server app. After a bit of research, I landed on the Swifter project for handling the socket connections and file transfers. While not as capable as a production quality server like Vapor, it was perfect for the simple and lightweight solution I had in mind.

The focus for this new app was to not be a production web server. These features are great for development and not something you’d want on a real server:

  • No caching — Every request gets a new response, no cache busters needed
  • Easy to configure — Pick a folder and go, recent folders let you switch sites instantly
  • Directory listings — A handy list of files whenever you hit a URL that doesn’t exist
  • Bonjour support — Automatic DNS for easy access using devices on your local network
  • REST friendly — Set default responses as JSON or XML for easy mocking of APIs
  • No dependencies — Completely standalone, no need for other tools like Python or Ruby
  • Simplified logging — Track requests & responses in Terminal with an easy-to-read format
  • Built-in security — Runs completely in a sandbox, no access to data unless you allow it
  • Powerful and lightweight — A small memory footprint with minimal CPU overhead
  • No rocket science — Perfect for people who are less technically inclined

Once I had all this running on macOS, I stumbled upon something unexpected. All of the Swift code I had written for macOS worked perfectly on iOS. With multi-tasking and a great text editor, iPadOS was suddenly a viable environment for standalone web development.

Bonjour is the glue that ties it all together. It’s effortless to start a server on your Mac and view your content on an iPhone or iPad. Or vice versa. It’s been the perfect tool for managing the video help library content in Linea Sketch: it lets Ged and me work together without a complex setup and ensures that things look great on all screens.

We only had one thing left to do: come up with a good name. During that search, we came across the first name. The thing that made the original WorldWideWeb so great was its ability to combine editing and serving of content into a single app. Our new WorldWideWeb continues that tradition: allowing a single device, like your iPad, to perform both tasks.

Actually, that’s a lie. We had two things left to do: the app also needed a kick-ass icon. It seemed fitting to reach back to the time of Aqua for this one: who better to do that than Dave Brasgalla?

The good news is that both apps are FREE on macOS, iPadOS, and iOS. It felt right to give something back to the web community that has give us so much over the years, so download the apps today and enjoy making great content no matter where you are!