Simply static ⏩
Hello friends!
I hope you're enjoying this Serial Maker newsletter! If you missed any of the past editions, make sure to check them out. And if you know someone who might benefit from this newsletter, please forward this email to a friend. 😀
Lately, I've been handed a number of projects where I'm required to make edits to an existing static website. Often, these sites require an actual webserver to run. You can't just double click on the index file and expect the site to work. Up until recently, I would have created a local virtual host, added a local domain to my hosts file, and then deployed everything to a subdirectory on my Linux web server for client review.
That workflow is tedious and overkill with all the tooling and cloud services available today. Let's optimize this.
This issue is all about rapid static website development ⏩
TLDR
Local development
When I needed a development environment for testing a static site locally, I used to manage everything with my local version of Apache. This requires creating a virtual host in the config and then adding a development URL to your hosts file to point to that virtual host. Before long, you may have tens or hundreds of virtual hosts for all your projects. It's unmanageable.
There are lots of other ways to get a local development up and running on your coding machine. Docker is a good one. Or you can setup a webpack workflow with Node.js scripts. But often these are overkill as well.
When all you have is a static site, with zero back-end dependencies (no database, no transpilers, etc.) all you really need is an on-demand local webserver. The flat-out simplest of these is local-web-server. Just run the command ws from your working directory, and you have a web server hosting your website on your development machine. No more virtual hosts or containers.
Deployment
Over time, I've collected a large number of subdomains on my sixoverground.com server that serve as staging environments for client work. I'm already paying for the Linux dedicated box, so why not just build on top of that? Well, it's also unmanageable. I don't want to have to keep provisioning subdomains, and adding to resources on my company server. There's a better way.
The cheapest static file hosting available is Amazon S3. And when you have a static website, all you need is a place to host your static files. Luckily, S3 has an option to enable static website hosting. You get your own root domain for an entire site. And you only pay for the usage! For throwaway client review sites, this is pennies. There are a few steps to transform a basic S3 bucket into a static hosting machine, and I've outlined them in this article.
When I'm done with one of these review sites, I simply delete it from AWS. That's it.
A better way?
If you know of a better way to develop and deploy static websites, I'd love to know your techniques. Reply, and I can do a follow up with some other options. I'm constantly adjusting my own workflow, looking for more efficiency where I can find it!
Keep making, and thanks for reading! 🙌
Hit reply to tell me what you're making. I'm looking for anyone interested in talking about their own side-projects and maker journey, so speak up if you'd like to appear in Serial Maker. I'd also love to know what you thought of this issue, and what you want to hear about in the future.
Until next week,
Craig


