Jump to content
Sign in to follow this  
aviris

Host Current Finder folder at localhost with Harp.js

Recommended Posts

Download Here

 

This Alfred Workflow will take the active Finder window and serve it up with Harp (http://harpjs.com) web server at localhost:9090. It even opens Safari to http://localhost:9090 for you.**

Triggering the workflow while a Harp instance is already serving a Finder directory increment the port number by one (e.g. http://localhost:9091), allowing you to serve several different folders at the same time on your machine.

 

Harp web server automatically preprocesses Jade, Markdown, EJS, CoffeeScript, Sass, LESS and Stylus and serves it as HTML, CSS & JavaScript—no configuration necessary. It even does the vendor prefixing for you.

 

 

Prerequisites:

Harp Web Server

  - Node (http://nodejs.org)

  - NPM (included with Node)

 

Once you have installed Node, install Harp with

npm install -g harp

Harp Quick Start

 

** This is my use of AppleScript so by the time I got the Terminal window checking and port incrementing working I just put a simple 2 second delay before calling Safari. If Terminal isn't open and Safari is, depending on your machine it may take more than 2 seconds for Harp to initialize. Just hit the reload button in Safari. Or change it to wait a bit longer. Or if you are an AppleScript guru, fix it to wait until Harp is running, then call Safari.

 

Feel free to modify the Applescript for whatever shell commands you may want to issue - I know Harp isn't the only Node based web server around. 

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  
×
×
  • Create New...