Skip to content

Instantly share code, notes, and snippets.

@timmow
Last active December 13, 2015 20:08
Show Gist options
  • Select an option

  • Save timmow/4967653 to your computer and use it in GitHub Desktop.

Select an option

Save timmow/4967653 to your computer and use it in GitHub Desktop.
Very simple static websites on osx with pow and powder

Intro

Often you want to test out some simple static http / css / js code in your local environment. You could setup mass virtual hosting and dnsmasq with a wildcard domain to serve *.dev, but for purely static files, I find this is an easier setup. And there is less overhead, as pow spins up nodejs to serve a request rather than constantly having apache run in the background.

Pow

Pow is a zero-configuration Rack server for Mac OS X. You can install it with homebrew

brew install pow

And then follow the instructions brew prints out

sudo pow --install-system
pow --install-local

Powder

Powder is a gem which enables easy control of pow. To install,

gem install powder

Directory structure

Now create a directory which contains a public directory and an index.html file, and use powder to configure pow to serve the directory.

mkdir -p test/public
vim test/public/index.html
# add html content
powder link

Now load http://test.dev in your browser, and you should see the content of the index.html file loaded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment