A new version of Harp was released this week. Whether you using the Harp Platform and Dropbox, keep GitHub projects in one main directory, or use Harp as a headless web server, the latest version of Harp includes updates to Multihost that will be useful to you.
You can install this new version of Harp using:
sudo npm install -g harp
You may leave off
sudo if you’re on Windows or already have admin privileges. If you’re new to Harp, get started quickly here.
Harp v0.11.2 – Generic Multihost
Harp’s Multihost mode serves every subdirectory within the directory you specify. If you run
harp multihost inside a folder, all the projects inside will be available in the browser as subdomains of
Once you run
harp multihost, you can visit your local server in the browser (
localhost:9000 by default) and see the list of projects. Visiting any entry will take you to that project, served at a subdomain of
.harp.nu. So, in this example, the
sintaxi/ directory would be available at
sintaxi.harp.nu:9000. We’ll have more examples of how you can use Multihost in the docs this week.
All updates in v0.11.2
- Connect object now available when using Harp as middleware – @sintaxi
- Generic Multihost – @silentrob
harp init’s default 404 page clarified – @shovon
- Failed compile properly errors, allowing testing with toolchains – @remy
The especially curious may also review the commit log.
The expressions are learned, the cues hinted and stored
We learn and predict and build the image of our affection
Ethan Joachim Eldridge
With Harp, if you want your source content files to work as a static generated site, then you must refer to urls using
I don't like this.
Remy Sharp, Harp Static
We love feedback! If you’re not using Harp to serve the sites you compile with it, presently, you may need to choose between a clean directory structure, and hard-coding
.html in your links. (There’s a GitHub issue discussion on this, too.)
Other solutions to this problem include:
- Publishing your site with the Harp Platform. It runs Harp in production, so you automatically get clean URLs, just like with
- Trying the Harp buildpack for Heroku, featured in the previous edition of Harp Weekly.
- Using what Eric Drechsel developed: a small shell script that removes HTML extensions and deploys your Harp project to Amazon S3.